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

Sushanth Sowmyan commented on HIVE-10251:
-----------------------------------------

Thanks for the quick patch, Anant!

Looking through the changes, I'm +1 on this patch fixing this breakage, and not 
introducing any new breakage that I can see. Manual testing shows that this 
patch fixes the primary issue.

There are review comments though, and normally, we'd wait till all comments are 
resolved before applying the patch.

As to unit testing this, we could have a mock test, potentially, that shows 
that using a method from this class still works if 
ClassLoader.getSystemResource is not used statically as it currently is.

That said, as of right now, hive-trunk is broken for environments that do not 
have an ivysettings.xml file, and we need to fix it soon. We have a couple of 
options at hand that I see:

a) Revert HIVE-9664 till we have a fix for this that we're comfortable is the 
right fix and works properly, and then we can re-apply both.
b) Go ahead and apply HIVE-10251, possibly ignoring the 24hr moratorium, and 
take on an addendum jira to handle review comments and hardening of this 
issue's unit tests, etc.

Any thoughts? I'm personally leaning towards (b), but we do need to move 
quickly to fix trunk.

> HIVE-9664 makes hive depend on ivysettings.xml
> ----------------------------------------------
>
>                 Key: HIVE-10251
>                 URL: https://issues.apache.org/jira/browse/HIVE-10251
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Sushanth Sowmyan
>            Assignee: Anant Nag
>              Labels: patch
>         Attachments: HIVE-10251.1.patch
>
>
> HIVE-9664 makes hive depend on the existence of ivysettings.xml, and if it is 
> not present, it makes hive NPE when instantiating a CLISessionState.
> {noformat}
> java.lang.NullPointerException
> at 
> org.apache.hadoop.hive.ql.session.DependencyResolver.<init>(DependencyResolver.java:61)
> at 
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:343)
> at 
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:334)
> at org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:60)
> {noformat}
> This happens because of the following bit:
> {noformat}
>     // If HIVE_HOME is not defined or file is not found in HIVE_HOME/conf 
> then load default ivysettings.xml from class loader
>     if (ivysettingsPath == null || !(new File(ivysettingsPath).exists())) {
>       ivysettingsPath = 
> ClassLoader.getSystemResource("ivysettings.xml").getFile();
>       _console.printInfo("ivysettings.xml file not found in HIVE_HOME or 
> HIVE_CONF_DIR," + ivysettingsPath + " will be used");
>     }
> {noformat}
> This makes it so that an attempt to instantiate CliSessionState without an 
> ivysettings.xml file will cause hive to fail with an NPE. Hive should not 
> have a hard dependency on a ivysettings,xml being present, and this feature 
> should gracefully fail in that case instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to