[
https://issues.apache.org/jira/browse/HIVE-14717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15472659#comment-15472659
]
Ke Jia commented on HIVE-14717:
-------------------------------
Hi [~vihangk1] [~Ferd], Thank for you suggestion. Before HIVE-13589, Beeline
work with the follow cases:
{noformat}
1. beeline –u url –n user –p pass
2. beeline –u url –n user
3. beeline –u url –p pass
4. beeline –u url
5. beeline {noformat}
When the password is null, the code block below set it to empty string.
{noformat}
private String constructCmd(String url, String user, String pass, String
driver, boolean stripPasswd) {
String com = "!connect "
+ url + " "
+ (user == null || user.length() == 0 ? "''" : user) + " ";
if (stripPasswd) {
com += PASSWD_MASK + " ";
} else {
com += (pass == null || pass.length() == 0 ? "''" : pass) + " ";
}
com += (driver == null ? "" : driver);
return com;
} {noformat}
Beeline prompt user to enter password when the password is null in follow code.
However, because the above code have assigned the empty string to the
password, Beeline will never prompt user to enter password.
{noformat}
if (password == null) {
password = beeLine.getConsoleReader().readLine("Enter password for " +
url + ": ",
new Character('*'));
} {noformat}
In the patch of Hive-13589, we add a judgement(password == null ||
password.length() == 0)) in the follow code.
{noformat}
if (password == null || password.length() == 0) {
password = beeLine.getConsoleReader().readLine("Enter password for " +
url + ": ",
new Character('*'));
} {noformat}
So, After HIVE-13589, if the password is null or empty string, Beeline will
prompt user to enter password. So, for case 2 and 4, Beeline will ask user to
enter the password. So if want to achieve the goal that prompt user to enter
password, we need to add the judgement(password == null || password.length() ==
0)) even though we adopt the optional -p argument, I think. And this issue will
also occur. What about you?
> Beeline tests failing
> ---------------------
>
> Key: HIVE-14717
> URL: https://issues.apache.org/jira/browse/HIVE-14717
> Project: Hive
> Issue Type: Bug
> Reporter: Vihang Karajgaonkar
> Assignee: Vihang Karajgaonkar
> Priority: Critical
>
> If you run mvn clean test in beeline you see the following errors:
> {noformat}
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running org.apache.hive.beeline.cli.TestHiveCli
> Running org.apache.hive.beeline.TestBeelineArgParsing
> Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.584 sec -
> in org.apache.hive.beeline.TestBeelineArgParsing
> Running org.apache.hive.beeline.TestBeeLineHistory
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.198 sec -
> in org.apache.hive.beeline.TestBeeLineHistory
> Running org.apache.hive.beeline.TestBeeLineOpts
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.338 sec -
> in org.apache.hive.beeline.TestBeeLineOpts
> Running org.apache.hive.beeline.TestBufferedRows
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.382 sec -
> in org.apache.hive.beeline.TestBufferedRows
> Running org.apache.hive.beeline.TestClientCommandHookFactory
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.546 sec -
> in org.apache.hive.beeline.TestClientCommandHookFactory
> Running org.apache.hive.beeline.TestIncrementalRowsWithNormalization
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.379 sec -
> in org.apache.hive.beeline.TestIncrementalRowsWithNormalization
> Running org.apache.hive.beeline.TestTableOutputFormat
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.402 sec -
> in org.apache.hive.beeline.TestTableOutputFormat
> Results :
> Tests run: 44, Failures: 0, Errors: 0, Skipped: 0
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 01:03 min
> [INFO] Finished at: 2016-09-07T10:57:28-07:00
> [INFO] Final Memory: 65M/949M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on
> project hive-beeline: ExecutionException The forked VM terminated without
> properly saying goodbye. VM crash or System.exit called?
> [ERROR] Command was /bin/sh -c cd
> /Users/vihang/work/src/upstream/hive/beeline &&
> /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/bin/java
> -Xmx2048m -XX:MaxPermSize=512m -jar
> /Users/vihang/work/src/upstream/hive/beeline/target/surefire/surefirebooter8133887423099901737.jar
>
> /Users/vihang/work/src/upstream/hive/beeline/target/surefire/surefire6528142441948588259tmp
>
> /Users/vihang/work/src/upstream/hive/beeline/target/surefire/surefire_05570572112194455658tmp
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> {noformat}
> My guess is this is related to recent fix for HIVE-13589 but needs more
> investigation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)