David created HIVE-26132: ---------------------------- Summary: Schematool upgradeSchema fails with nullPointerException Key: HIVE-26132 URL: https://issues.apache.org/jira/browse/HIVE-26132 Project: Hive Issue Type: Bug Reporter: David
When running schematool upgradeSchema against a mysql database with a metastore_db, I get a nullPointerException. The command is: {{schematool -dbType mysql -upgradeSchema -verbose}} The same exception can be created by running the relevant hive upgrade script directly in beeline with the following command: {{beeline -u jdbc:mysql://mysql:3306/metastore_db -n [USER] -p[PASS] -f /usr/local/hive/scripts/metastore/upgrade/mysql/upgrade-2.3.0-to-3.0.0.mysql.sql}} Removing the follow lines from the sql script fixes this: {{SELECT 'Upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' ';}} {{SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' ';}} The beeline exception is: {quote}Connecting to jdbc:mysql://mysql:3306/metastore_db Connected to: MySQL (version 5.6.51) Driver: MySQL Connector/J (version mysql-connector-java-8.0.28 (Revision: 7ff2161da3899f379fb3171b6538b191b1c5c7e2)) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:mysql://mysql:3306/metastore_db> SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' '; The statement instance is not HiveStatement type: class com.mysql.cj.jdbc.StatementImpl The statement instance is not HiveStatement type: class com.mysql.cj.jdbc.StatementImpl java.lang.NullPointerException at java.lang.StringBuilder.<init>(StringBuilder.java:112) at org.apache.hive.beeline.ColorBuffer.center(ColorBuffer.java:81) at org.apache.hive.beeline.TableOutputFormat.getOutputString(TableOutputFormat.java:123) at org.apache.hive.beeline.TableOutputFormat.getOutputString(TableOutputFormat.java:108) at org.apache.hive.beeline.TableOutputFormat.print(TableOutputFormat.java:51) at org.apache.hive.beeline.BeeLine.print(BeeLine.java:2257) at org.apache.hive.beeline.Commands.executeInternal(Commands.java:1026) at org.apache.hive.beeline.Commands.execute(Commands.java:1201) at org.apache.hive.beeline.Commands.sql(Commands.java:1130) at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1425) at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:1287) at org.apache.hive.beeline.BeeLine.executeFile(BeeLine.java:1261) at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1064) at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) 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:226) at org.apache.hadoop.util.RunJar.main(RunJar.java:141) Closing: 0: jdbc:mysql://mysql:3306/metastore_db {quote} -- This message was sent by Atlassian Jira (v8.20.1#820001)