You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/10/23 15:05:51 UTC
[GitHub] [hive] ayushtkn opened a new pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
ayushtkn opened a new pull request #1605:
URL: https://github.com/apache/hive/pull/1605
https://issues.apache.org/jira/browse/HIVE-23935
Entire Trace -
0: jdbc:hive2://localhost:10000> !primarykeys Persons
Error: MetaException(message:java.lang.NullPointerException) (state=,code=0)
org.apache.hive.service.cli.HiveSQLException: MetaException(message:java.lang.NullPointerException)
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:360)
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:351)
at org.apache.hive.jdbc.HiveDatabaseMetaData.getPrimaryKeys(HiveDatabaseMetaData.java:573)
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.hive.beeline.Reflector.invoke(Reflector.java:89)
at org.apache.hive.beeline.Commands.metadata(Commands.java:125)
at org.apache.hive.beeline.Commands.primarykeys(Commands.java:231)
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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:57)
at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1465)
at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1504)
at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:1364)
at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1134)
at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1082)
at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:546)
at org.apache.hive.beeline.BeeLine.main(BeeLine.java:528)
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.util.RunJar.run(RunJar.java:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: org.apache.hive.service.cli.HiveSQLException: MetaException(message:java.lang.NullPointerException)
at org.apache.hive.service.cli.operation.GetPrimaryKeysOperation.runInternal(GetPrimaryKeysOperation.java:120)
at org.apache.hive.service.cli.operation.Operation.run(Operation.java:277)
at org.apache.hive.service.cli.session.HiveSessionImpl.getPrimaryKeys(HiveSessionImpl.java:997)
at org.apache.hive.service.cli.CLIService.getPrimaryKeys(CLIService.java:416)
at org.apache.hive.service.cli.thrift.ThriftCLIService.GetPrimaryKeys(ThriftCLIService.java:838)
at org.apache.hive.service.rpc.thrift.TCLIService$Processor$GetPrimaryKeys.getResult(TCLIService.java:1717)
at org.apache.hive.service.rpc.thrift.TCLIService$Processor$GetPrimaryKeys.getResult(TCLIService.java:1702)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
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: MetaException(message:java.lang.NullPointerException)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:7921)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.throwMetaException(HiveMetaStore.java:9105)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_primary_keys(HiveMetaStore.java:9067)
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:147)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:108)
at com.sun.proxy.$Proxy44.get_primary_keys(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getPrimaryKeys(HiveMetaStoreClient.java:2617)
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.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:215)
at com.sun.proxy.$Proxy45.getPrimaryKeys(Unknown Source)
at org.apache.hive.service.cli.operation.GetPrimaryKeysOperation.runInternal(GetPrimaryKeysOperation.java:94)
... 13 more
Caused by: java.lang.NullPointerException: null
at org.apache.hadoop.hive.metastore.utils.StringUtils.normalizeIdentifier(StringUtils.java:94)
at org.apache.hadoop.hive.metastore.ObjectStore.getPrimaryKeysInternal(ObjectStore.java:10723)
at org.apache.hadoop.hive.metastore.ObjectStore.getPrimaryKeys(ObjectStore.java:10713)
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.RawStoreProxy.invoke(RawStoreProxy.java:97)
at com.sun.proxy.$Proxy42.getPrimaryKeys(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_primary_keys(HiveMetaStore.java:9064)
... 28 more
Post Fix
: jdbc:hive2://localhost:10000> !primarykeys persons
+------------+--------------+-------------+--------------+----------+-------------------------------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | KEY_SEQ | PK_NAME |
+------------+--------------+-------------+--------------+----------+-------------------------------+
| | default | persons | id | 1 | pk_250096773_1595006111286_0 |
+------------+--------------+-------------+--------------+----------+-------------------------------+
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] ayushtkn commented on a change in pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #1605:
URL: https://github.com/apache/hive/pull/1605#discussion_r511318476
##########
File path: standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java
##########
@@ -1124,6 +1125,40 @@ public void testEmptyTrustStoreProps() {
setAndCheckSSLProperties(true, "", "", "jks");
}
+ /**
+ * Tests getPrimaryKeys() when db_name isn't specified.
+ */
+ @Test
+ public void testGetPrimaryKeys() throws Exception {
Review comment:
The change itself is in ObjectStore, and the API too is in ObjectStore. The `TestPrimaryKey` is a parametrised test and for one case, this issue doesn't happen. I think the test is better here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] ashish-kumar-sharma commented on a change in pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on a change in pull request #1605:
URL: https://github.com/apache/hive/pull/1605#discussion_r511362503
##########
File path: standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java
##########
@@ -1124,6 +1125,40 @@ public void testEmptyTrustStoreProps() {
setAndCheckSSLProperties(true, "", "", "jks");
}
+ /**
+ * Tests getPrimaryKeys() when db_name isn't specified.
+ */
+ @Test
+ public void testGetPrimaryKeys() throws Exception {
Review comment:
You are right that its part of ObjectStore but TestPrimaryKey class was created so that we can have all sort of test for primary key in one place.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] github-actions[bot] commented on pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1605:
URL: https://github.com/apache/hive/pull/1605#issuecomment-750677661
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] ayushtkn commented on a change in pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #1605:
URL: https://github.com/apache/hive/pull/1605#discussion_r511305357
##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -10833,7 +10833,8 @@ public FileMetadataHandler getFileMetadataHandler(FileMetadataExprType type) {
final String db_name_input,
final String tbl_name_input)
throws MetaException, NoSuchObjectException {
- final String db_name = normalizeIdentifier(db_name_input);
+ final String db_name =
Review comment:
Thanx @ashish-kumar-sharma
1. I will address.
2. Why for catName? It isn't getting accessed anywhere which can fetch any NPE.
3. I didn't catch this? I haven't introduce any variable itself.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] ashish-kumar-sharma commented on a change in pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on a change in pull request #1605:
URL: https://github.com/apache/hive/pull/1605#discussion_r511361890
##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -10833,7 +10833,8 @@ public FileMetadataHandler getFileMetadataHandler(FileMetadataExprType type) {
final String db_name_input,
final String tbl_name_input)
throws MetaException, NoSuchObjectException {
- final String db_name = normalizeIdentifier(db_name_input);
+ final String db_name =
Review comment:
@ayushtkn
1. You haven't introduce any new variable but since you can change the name of other variable as well along with your PR for sanity
2. For catName, dbName and tableName its better to check and normalize everywhere which helps in making sure that hive is case insensitive for name.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] github-actions[bot] closed pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1605:
URL: https://github.com/apache/hive/pull/1605
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] ashish-kumar-sharma commented on a change in pull request #1605: HIVE-23935. Fetching primaryKey through beeline fails with NPE
Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on a change in pull request #1605:
URL: https://github.com/apache/hive/pull/1605#discussion_r511299604
##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -10833,7 +10833,8 @@ public FileMetadataHandler getFileMetadataHandler(FileMetadataExprType type) {
final String db_name_input,
final String tbl_name_input)
throws MetaException, NoSuchObjectException {
- final String db_name = normalizeIdentifier(db_name_input);
+ final String db_name =
Review comment:
1. Can we use StringUtils.isNotBlank(db_name_input) instead of (db_name_input!=null).
2. Also can we have the same check on catName.
3. Can we use unified camel casing naming convention across variable name.
##########
File path: standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java
##########
@@ -1124,6 +1125,40 @@ public void testEmptyTrustStoreProps() {
setAndCheckSSLProperties(true, "", "", "jks");
}
+ /**
+ * Tests getPrimaryKeys() when db_name isn't specified.
+ */
+ @Test
+ public void testGetPrimaryKeys() throws Exception {
Review comment:
Please add this Test to class TestPrimaryKey.java
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org