rkirtir commented on code in PR #4188:
URL: https://github.com/apache/hive/pull/4188#discussion_r1214153820


##########
beeline/src/java/org/apache/hive/beeline/Commands.java:
##########
@@ -1202,16 +1202,24 @@ private boolean execute(String line, boolean call, 
boolean entireLineAsCommand)
     // bug 879518.
 
     // use multiple lines for statements not terminated by the delimiter
-    try {
-      line = handleMultiLineCmd(line);
-    } catch (Exception e) {
-      beeLine.handleException(e);
+    if ((beeLine.getOpts().getScriptFile() == null) || 
(beeLine.getOpts().getScriptFile().endsWith("temp"))){
+      try {
+        line = handleMultiLineCmd(line);
+      } catch (Exception e) {
+        beeLine.handleException(e);
+      }
+      line = line.trim();
     }
 
-    line = line.trim();
     List<String> cmdList = getCmdList(line, entireLineAsCommand);
+    String sql = null;
     for (int i = 0; i < cmdList.size(); i++) {
-      String sql = cmdList.get(i).trim();
+      if ((beeLine.getOpts().getScriptFile() == null) || 
(beeLine.getOpts().getScriptFile().endsWith("temp"))){
+        sql = cmdList.get(i).trim();
+      }

Review Comment:
   Can be simplified with ternary op
   
   sql = (beeLine.getOpts().getScriptFile() == null) || 
(beeLine.getOpts().getScriptFile().endsWith("temp"))
                 ? cmdList.get(i).trim():cmdList.get(i);



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to