[ https://issues.apache.org/jira/browse/HIVE-23935?focusedWorklogId=843316&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-843316 ]
ASF GitHub Bot logged work on HIVE-23935: ----------------------------------------- Author: ASF GitHub Bot Created on: 02/Feb/23 19:41 Start Date: 02/Feb/23 19:41 Worklog Time Spent: 10m Work Description: ayushtkn commented on code in PR #4009: URL: https://github.com/apache/hive/pull/4009#discussion_r1095010784 ########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java: ########## @@ -12025,7 +12025,9 @@ private List<SQLPrimaryKey> getPrimaryKeysInternal(final String catName, 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 = StringUtils.isNotBlank(db_name_input) ? Review Comment: >what about fixing this in normalizeIdentifier instead? This backfired 😅 This method is widely used, has some 500+ usage and some tests explicitly asks for an NPE which later gets converted to MetaException, because of this it doesn't fail here rather in the end fails with NoSuchObjectException in many cases. Reverting back to original for now to fix this only Issue Time Tracking ------------------- Worklog Id: (was: 843316) Time Spent: 3h 10m (was: 3h) > Fetching primaryKey through beeline fails with NPE > -------------------------------------------------- > > Key: HIVE-23935 > URL: https://issues.apache.org/jira/browse/HIVE-23935 > Project: Hive > Issue Type: Bug > Reporter: Ayush Saxena > Assignee: Ayush Saxena > Priority: Major > Labels: pull-request-available > Time Spent: 3h 10m > Remaining Estimate: 0h > > Fetching PrimaryKey of a table through Beeline !primarykey fails with NPE > {noformat} > 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){noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)