[ https://issues.apache.org/jira/browse/HIVE-26062?focusedWorklogId=747654&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-747654 ]
ASF GitHub Bot logged work on HIVE-26062: ----------------------------------------- Author: ASF GitHub Bot Created on: 25/Mar/22 08:03 Start Date: 25/Mar/22 08:03 Worklog Time Spent: 10m Work Description: dengzhhu653 commented on a change in pull request #3138: URL: https://github.com/apache/hive/pull/3138#discussion_r835034203 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java ########## @@ -205,19 +206,32 @@ public boolean isVersionCompatible(String hiveVersion, String dbVersion) { return false; } - for (int i = 0; i < dbVerParts.length; i++) { - int dbVerPart = Integer.parseInt(dbVerParts[i]); - int hiveVerPart = Integer.parseInt(hiveVerParts[i]); - if (dbVerPart > hiveVerPart) { - return true; - } else if (dbVerPart < hiveVerPart) { - return false; - } else { - continue; // compare next part + int i = 0; Review comment: If `i` reaches the end of `dbVerParts`, means that the hive version is behind the db version, which supposed to be compatiable. For example, dbVerParts is `4`, `0`, `0` hiveVerParts is `4`, `0`, `0`, `alpha`, `1` the `hiveVerParts.length == dbVerParts.length;` returns false in this case. -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 747654) Time Spent: 1h 20m (was: 1h 10m) > Make sure that running 4.0.0-alpha-2 above 4.0.0-alpha-1 HMS DB reports the > correct error > ----------------------------------------------------------------------------------------- > > Key: HIVE-26062 > URL: https://issues.apache.org/jira/browse/HIVE-26062 > Project: Hive > Issue Type: Task > Reporter: Peter Vary > Priority: Major > Labels: pull-request-available > Time Spent: 1h 20m > Remaining Estimate: 0h > > When comparing expected and actual HMS DB versions the code has problems with > parsing {{alpha-1}}. We should make sure that the appropriate error message > is returned to the customer instead of a {{NumberFormatException}}. > Currently we have this, and we might just want to return {{false}} if there > is no exact match: > {code} > java.lang.NumberFormatException: For input string: "0-alpha-1" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) > at java.lang.Integer.parseInt(Integer.java:580) > at java.lang.Integer.parseInt(Integer.java:615) > at > org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.isVersionCompatible(MetaStoreSchemaInfo.java:210) > at > org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:10870) > at > org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:10839) > 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.$Proxy28.verifySchema(Unknown Source) > at > org.apache.hadoop.hive.metastore.HMSHandler.getMSForConf(HMSHandler.java:610) > at org.apache.hadoop.hive.metastore.HMSHandler.getMS(HMSHandler.java:602) > at > org.apache.hadoop.hive.metastore.HMSHandler.createDefaultDB(HMSHandler.java:686) > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)