[ https://issues.apache.org/jira/browse/HIVE-22355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16989913#comment-16989913 ]
Mate Juhasz commented on HIVE-22355: ------------------------------------ Hi [~thejas] and [~ngangam]! Thanks for your thoughts! I like the idea of picking the current unix username and I guess something similar would do the trick: {noformat} if ("NONE".equals(auth)) { if (username == null) { username = System.getProperty("user.name"); } props.setProperty(JdbcConnectionParams.AUTH_USER, username); } else... {noformat} The main idea would be to skip prompting, even if we dont specify username/password in the url/cli options when we are in an "unsecure" environment (without kerberos). Basically when we hit beeline without any additional args and its reading the jdbc url from beeline-site.xml This usually happens during a Sqoop hive-import, where it is a real problem in unsecure envs, since they migrated to beeline from hive cli. While there is a workaround SQOOP-3423, its uncomfortable for users/requires changes in their scripts etc... By adding auth=NONE to beeline-site.xml the connection could be smooth but unchanged in this case. Please correct me if I am missing something. Thanks > Beeline should not prompt for hive user and password when authentication is > NONE > -------------------------------------------------------------------------------- > > Key: HIVE-22355 > URL: https://issues.apache.org/jira/browse/HIVE-22355 > Project: Hive > Issue Type: Bug > Components: Beeline > Reporter: Mate Juhasz > Assignee: Mate Juhasz > Priority: Major > Attachments: HIVE-22355.1.patch, HIVE-22355.2.patch, > HIVE-22355.3.patch > > > Beeline - without adding the jdbc url - prompts for username and password in > case hive.server2.authentication=NONE, which is possibly pointless and can be > misleading for users as any input is accepted. > In addition, Sqoop has dropped hive cli recently in favor of beeline and if > there is no authentication set in Hive, Sqoop fails to connect as the process > stops waiting for the user/password input. > I think it would be nice to check the auth type "NONE" before reading unused > inputs from the console before this point: > https://github.com/apache/hive/blob/master/beeline/src/java/org/apache/hive/beeline/Commands.java#L1641 -- This message was sent by Atlassian Jira (v8.3.4#803005)