Ayub Khan created ATLAS-1274: -------------------------------- Summary: HiveHook fails for temporary table Key: ATLAS-1274 URL: https://issues.apache.org/jira/browse/ATLAS-1274 Project: Atlas Issue Type: Bug Affects Versions: trunk Reporter: Ayub Khan
STR: Create a temporary table HiveServer2 logs for temporary table creation shows Atlas Hook failure.. {noformat} 2016-11-08 09:03:24,127 INFO [Atlas Logger 0]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(391)) - ugi=hive/atlas-kerberos-storm-testing-re-3.openstacklo...@example.com ip=unknown-ip-addr cmd=get_database: default 2016-11-08 09:03:24,135 INFO [Atlas Logger 0]: bridge.HiveMetaStoreBridge (HiveMetaStoreBridge.java:createOrUpdateDBInstance(166)) - Importing objects from databaseName : default 2016-11-08 09:03:24,136 INFO [HiveServer2-Handler-Pool: Thread-9278]: session.HiveSessionImpl (HiveSessionImpl.java:acquireAfterOpLock(332)) - We are setting the hadoop caller context to e475f3d2-121e-41e3-aab9-0a4e2f739bcf for thread HiveServer2-Handler-Pool: Thread-9278 2016-11-08 09:03:24,136 INFO [HiveServer2-Handler-Pool: Thread-9278]: session.HiveSessionImpl (HiveSessionImpl.java:releaseBeforeOpLock(356)) - We are resetting the hadoop caller context for thread HiveServer2-Handler-Pool: Thread-9278 2016-11-08 09:03:24,137 INFO [Atlas Logger 0]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(822)) - 7: get_table : db=default tbl=tableNExxs1L84UFAB 2016-11-08 09:03:24,137 INFO [Atlas Logger 0]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(391)) - ugi=hive/atlas-kerberos-storm-testing-re-3.openstacklo...@example.com ip=unknown-ip-addr cmd=get_table : db=default tbl=tableNExxs1L84UFAB 2016-11-08 09:03:24,146 ERROR [Atlas Logger 0]: metadata.Hive (Hive.java:getTable(1160)) - Table tableNExxs1L84UFAB not found: default.tableNExxs1L84UFAB table not found 2016-11-08 09:03:24,146 ERROR [Atlas Logger 0]: hook.HiveHook (HiveHook.java:run(187)) - Atlas hook failed due to error org.apache.hadoop.hive.ql.metadata.InvalidTableException: Table not found tableNExxs1L84UFAB at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:1161) at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:1131) at org.apache.atlas.hive.hook.HiveHook.createOrUpdateEntities(HiveHook.java:516) at org.apache.atlas.hive.hook.HiveHook.createOrUpdateEntities(HiveHook.java:538) at org.apache.atlas.hive.hook.HiveHook.handleEventOutputs(HiveHook.java:544) at org.apache.atlas.hive.hook.HiveHook.fireAndForget(HiveHook.java:211) at org.apache.atlas.hive.hook.HiveHook.access$200(HiveHook.java:81) at org.apache.atlas.hive.hook.HiveHook$2.run(HiveHook.java:185) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-11-08 09:03:24,182 INFO [HiveServer2-Handler-Pool: Thread-9278]: session.HiveSessionImpl (HiveSessionImpl.java:acquireAfterOpLock(332)) - We are setting the hadoop caller context to e475f3d2-121e-41e3-aab9-0a4e2f739bcf for thread HiveServer2-Handler-Pool: Thread-9278 2016-11-08 09:03:24,183 INFO [HiveServer2-Handler-Pool: Thread-9278]: session.HiveSessionImpl (HiveSessionImpl.java:releaseBeforeOpLock(356)) - We are resetting the hadoop caller context for thread HiveServer2-Handler-Pool: Thread-9278 {noformat} *Root cause*: Hive temporary tables are local to that specific session and once the session ends the temporary tables are cleared off.. With that context, I guess when tried to get the hive table details using "org.apache.hadoop.hive.ql.metadata.Hive.getTable", new session is used which does not have access to the temprorary tables created in another session. -- This message was sent by Atlassian JIRA (v6.3.4#6332)