Update Hive Metastore

Update Hive Metastore

Hive 0.12 includes the Schema update tool


$ bin/schematool -help
usage: schemaTool
-dbType <databaseType>             Metastore database type
-dryRun                            list SQL scripts (no execute)
-help                              print this message
-info                              Show config and schema details
-initSchema                        Schema initialization
-initSchemaTo <initTo>             Schema initialization to a version
-passWord <password>               Override config file password
-upgradeSchema                     Schema upgrade
-upgradeSchemaFrom <upgradeFrom>   Schema upgrade from a version
-userName <user>                   Override config file user name
-verbose                           only print SQL statements


Depending on what metastore you are using

dbType can be

mysql, postgres, derby or oracle

Update MySQL Hive metastore from 0.10.0 to 0.12.0
For example

bin/schematool -dbType mysql -upgradeSchemaFrom 0.10.0

You can also do a dry run with passing option -dryRun



No comments:

Post a Comment

Please share your views and comments below.

Thank You.