You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/04/29 12:14:36 UTC

[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #2518: [KYUUBI #2478][FOLLOWUP] Invoke getOpts method instead of Reflection

pan3793 commented on code in PR #2518:
URL: https://github.com/apache/incubator-kyuubi/pull/2518#discussion_r861745317


##########
kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java:
##########
@@ -162,15 +162,7 @@ int initArgs(String[] args) {
     int code = 0;
     if (cl.getOptionValues('e') != null) {
       commands = Arrays.asList(cl.getOptionValues('e'));
-      try {
-        Field optsField = BeeLine.class.getDeclaredField("opts");
-        optsField.setAccessible(true);
-        BeeLineOpts opts = (BeeLineOpts) optsField.get(this);
-        opts.setAllowMultiLineCommand(false);
-      } catch (Exception t) {
-        error(t.getMessage());
-        return 1;
-      }
+      getOpts().setAllowMultiLineCommand(false); // When using -e, command is always a single line

Review Comment:
   How about putting a Hive JIRA ticket ID here?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org