Andrew Wong has uploaded this change for review. (
http://gerrit.cloudera.org:8080/13424
Change subject: hms plugin: don't expect table type
......................................................................
hms plugin: don't expect table type
While the HMS Thrift client will enforce a table type to be present,
it's still possible for an HMS to create such a table. This resulted in
a NPE in the Kudu HMS plugin:
2019-05-23 01:02:31,014 INFO
org.apache.hadoop.hive.metastore.HiveMetaStore.audit: [pool-14-thread-25]:
ugi=hue ip=10.65.28.176 cmd=source:10.65.28.176 create_table:
Table(tableName:CM_TEST_TABLE,
dbName:cloudera_manager_metastore_canary_test_db_hive_1_hivemetastore_86b8275f9909af198bdf2a65e6fd501b,
owner:null, createTime:0, lastAccessTime:0, retention:0,
sd:StorageDescriptor(cols:[FieldSchema(name:s, type:string, comment:test
string), FieldSchema(name:f, type:float, comment:test float),
FieldSchema(name:a, type:array<map<string,struct<p1:int,p2:int>>>, comment:test
complex type)], location:null, inputFormat:null, outputFormat:null,
compressed:false, numBuckets:1, serdeInfo:SerDeInfo(name:CM_TEST_TABLE,
serializationLib:null, parameters:{serialization.format=1}), bucketCols:[],
sortCols:[], parameters:{}), partitionKeys:[FieldSchema(name:p1, type:string,
comment:partition-key-1), FieldSchema(name:p2, type:int,
comment:partition-key-2)], parameters:null, viewOriginalText:null,
viewExpandedText:null, tableType:null, ownerType:USER)
... // note the null table type
2019-05-23 01:02:31,117 ERROR
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-14-thread-25]:
MetaException(message:java.lang.NullPointerException)
at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:6236)
at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:140)
at
org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:99)
at com.sun.proxy.$Proxy32.create_table_with_environment_context(Unknown
Source)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$create_table_with_environment_context.getResult(ThriftHiveMetastore.java:10993)
at
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$create_table_with_environment_context.getResult(ThriftHiveMetastore.java:10977)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at
org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:110)
at
org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:106)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1875)
at
org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:118)
at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at
org.apache.kudu.hive.metastore.KuduMetastorePlugin.onCreateTable(KuduMetastorePlugin.java:90)
at
org.apache.hadoop.hive.metastore.MetaStoreListenerNotifier$13.notify(MetaStoreListenerNotifier.java:76)
at
org.apache.hadoop.hive.metastore.MetaStoreListenerNotifier.notifyEvent(MetaStoreListenerNotifier.java:175)
at
org.apache.hadoop.hive.metastore.MetaStoreListenerNotifier.notifyEvent(MetaStoreListenerNotifier.java:205)
at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1576)
at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1615)
... 20 more
This patch handles this by not dereferencing the pointers to check table type.
Change-Id: If76533a94f6ef2ae135af4bd441fc2652a6a5dda
---
M
java/kudu-hive/src/main/java/org/apache/kudu/hive/metastore/KuduMetastorePlugin.java
1 file changed, 9 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/24/13424/1
--
To view, visit http://gerrit.cloudera.org:8080/13424
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If76533a94f6ef2ae135af4bd441fc2652a6a5dda
Gerrit-Change-Number: 13424
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <[email protected]>