Troubleshooting Hive Upgrade Issues
This section describes how to troubleshoot inconsistencies in an underlying database after creating tables with the datanucleus.schema.autoCreateAll
property.
Prerequisites
The datanucleus.schema.autoCreateAll
property creates tables gradually.
After creating tables using this property, if you upgrade to Hive 2.3 using schematool
,
the schematool
command will not be able to verify all the necessary tables
because all the necessary tables were not created by the datanucleus.schema.autoCreateAll
property.
Procedure
- Determine the version from which you are upgrading.
-
Start MySQL:
mysql -u <user> -p <password>
-
Run the following commands in your MySQL command line.
USE metastore; source /opt/mapr/hive/hive-3.1.3/scripts/metastore/upgrade/mysql/hive-schema-2.3.0.mysql.sql source /opt/mapr/hive/hive-3.1.3/scripts/metastore/upgrade/mysql/hive-txn-schema-2.3.0.mysql.sql
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-schema -1.2.0.mysql.sql; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-txn-schema -0.13.0.mysql.sql;
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/hive-schema-0.14.0. mysql.sql;
USE metastore; SOURCE /opt/mapr/hive/hive-2.1/scripts/metastore/upgrade/mysql/ hive-schema-0.13.0.mysql.sql;
Results
schematool
command with the
-upgradeSchema
option.