Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 03-21-2017 06:33 AM - edited 09-16-2022 04:17 AM
Hi All,.
I was trying to run below query in Hortonworks VMware and gettting error. Can anyone explain what is the reason for it and how it can resolved. This same query worked in Cloudera VMware.
Query: select current_database();
Version: Hive 1.2.1.2.3.2.0-2950
Error:
FAILED: Hive Internal Error: java.lang.NullPointerException(null) java.lang.NullPointerException at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerDatabase(HiveMetaStoreBridge.java:109) at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerTable(HiveMetaStoreBridge.java:270) at org.apache.atlas.hive.hook.HiveHook.registerProcess(HiveHook.java:309) at org.apache.atlas.hive.hook.HiveHook.fireAndForget(HiveHook.java:202) at org.apache.atlas.hive.hook.HiveHook.run(HiveHook.java:160) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1522) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1195) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1059) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Thanks,
Created 03-21-2017 06:39 AM
In the stackTrace we see "org.apache.atlas.hive.hook.HiveHook" So can you try removing this property from your hive config and then try again.
Ambari UI --> Hive --> Configs -> Advanced tab --> Search for "hive.exec.failure.hooks" and then from there you remove the mentioned property if present.
Created 03-21-2017 06:39 AM
In the stackTrace we see "org.apache.atlas.hive.hook.HiveHook" So can you try removing this property from your hive config and then try again.
Ambari UI --> Hive --> Configs -> Advanced tab --> Search for "hive.exec.failure.hooks" and then from there you remove the mentioned property if present.
Created 03-21-2017 08:18 AM
In Advanced Settings > General > Property name "hive.exec.post.hooks" , I removed
"org.apache.atlas.hive.hook.HiveHook" entry
Still same error !
Created 03-21-2017 08:20 AM
Are you still seeing the same stackTrace which has the following line (even after removing "org.apache.atlas.hive.hook.HiveHook" )?
org.apache.atlas.hive.hook.HiveHook.registerProcess(HiveHook.java:309) at
Can you please post the stackTrace again. It might be slightly different.
.
Created 03-21-2017 08:22 AM
hive> select current_database(); FAILED: Hive Internal Error: java.lang.NullPointerException(null) java.lang.NullPointerException at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerDatabase(HiveMetaStoreBridge.java:109) at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerTable(HiveMetaStoreBridge.java:270) at org.apache.atlas.hive.hook.HiveHook.registerProcess(HiveHook.java:309) at org.apache.atlas.hive.hook.HiveHook.fireAndForget(HiveHook.java:202) at org.apache.atlas.hive.hook.HiveHook.run(HiveHook.java:160) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1522) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1195) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1059) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Created 03-21-2017 08:28 AM
It is strange to see the class "org.apache.atlas.hive.hook.HiveHook" in the stackTrace even if you deleted that hook from your hive config. Have your changes made via ambari got reflected properly to the host where you are running hive shell?
- Can you please check and share the file " /etc/hive/conf/hive-site.xml" and verify if you have the following emtry in it ?
<property>
<name>hive.exec.post.hooks</name>
<value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
</property>
<property>
<name>hive.exec.pre.hooks</name>
<value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
</property>
.
Created 03-21-2017 10:26 AM
Good to know that this issue is resolved. Please mark this thread as "Accepted" so that it will be helpful for others.
Created 03-21-2017 08:51 AM
Thanks Jay !!
I got it. I need not to make change in Ambari, I can do it simply through CLI. It worked. Making change in Ambari was not reflected in "/etc/hive/conf/hive-site.xml". I don't know why.
hive> set hive.exec.post.hooks; hive.exec.post.hooks=org.apache.hadoop.hive.ql.hooks.ATSHook, org.apache.atlas.hive.hook.HiveHook hive> set hive.exec.post.hooks=org.apache.hadoop.hive.ql.hooks.ATSHook; hive> select current_database(); OK default Time taken: 3.074 seconds, Fetched: 1 row(s)
Created 10-11-2017 12:50 AM
@Jay SenSharma, @Shalini Goel - does this change have any impact on functioning of Atlas in the cluster ? As per HDP doc, we need to have the following:
hive.exec.post.hooks=org.apache.hadoop.hive.ql.hooks.ATSHook, org.apache.atlas.hive.hook.HiveHook