[ 
https://issues.apache.org/jira/browse/HIVE-22355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16986823#comment-16986823
 ] 

Peter Vary edited comment on HIVE-22355 at 12/3/19 11:47 AM:
-------------------------------------------------------------

Hi [~matijhs],

Thanks for the patch. Could you please open a pull request, or a review board 
request?

Few questions:

 * Why is this change necessary:
{code:java}
auth = 
getHiveConf(false).get(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.varname); 
{code}
getHiveConf does with false tries to read hive-conf from the classpath - which 
usually should not be there. Why is this change necessary?

 * I would prefer "NONE", or even better a constant in HiveConf instead of 
.getDefaultValue() - this is not descriptive, and might change without anyone 
noticing it:
{code:java}
if 
(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.getDefaultValue().equals(auth)) 
{ {code}
 * Are you sure of this change:
{code:java}
password = beeLine.getConsoleReader().readLine("Enter password for " + 
urlForPrompt + ": ", '*'); {code}
Seems reasonable, also unnecessary, so I would want to be absolutely sure that 
nothing changes with removing "new Character()" before doing so :)
 * The test changes suggest to me, that this is a backward incompatible change:
{code:java}
argList.add("-a");
argList.add("NOT_NONE"); {code}
Do I miss something, or this is intended? I would prefer a change that is 
backward compatible (proven by tests)
 * Please fix the *new* checkstyle errors

Thanks,
Peter

 


was (Author: pvary):
Hi [~matijhs],

Thanks for the patch. Could you please open a pull request, or a review board 
request?

Few questions:

 * Why is this change necessary:
{code:java}
auth = 
getHiveConf(false).get(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.varname); 
{code}
getHiveConf does with false tries to read hive-conf from the classpath - which 
usually should not be there. Why is this change necessary?

 * I would prefer "NONE", or even better a constant in HiveConf instead of 
.getDefaultValue() - this is not descriptive, and might change without anyone 
noticing it:
{code:java}
if 
(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.getDefaultValue().equals(auth)) 
{ {code}
 * Are you sure of this change:
{code:java}
password = beeLine.getConsoleReader().readLine("Enter password for " + 
urlForPrompt + ": ", '*'); {code}
Seems reasonable, also unnecessary, so I would want to be absolutely sure that 
nothing changes with removing "new Character()" before doing :)
 * The test changes suggest to me, that this is a backward incompatible change:
{code:java}
argList.add("-a");
argList.add("NOT_NONE"); {code}
Do I miss something, or this is intended? I would prefer a change that is 
backward compatible (proven by tests)
 * Please fix the *new* checkstyle errors

Thanks,
Peter

 

> 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
>
>
> 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)

Reply via email to