public class HiveSchemaTool extends Object
| Constructor and Description |
|---|
HiveSchemaTool(String hiveHome,
HiveConf hiveConf,
String dbType,
String metaDbType) |
HiveSchemaTool(String dbType,
String metaDbType) |
| Modifier and Type | Method and Description |
|---|---|
void |
doInit()
Initialize the metastore schema to current version
|
void |
doInit(String toVersion)
Initialize the metastore schema
|
void |
doUpgrade()
Perform metastore schema upgrade.
|
void |
doUpgrade(String fromSchemaVer)
Perform metastore schema upgrade
|
void |
doValidate() |
HiveConf |
getHiveConf() |
static void |
main(String[] args) |
void |
runBeeLine(String sqlScriptFile) |
void |
setDbOpts(String dbOpts) |
void |
setDriver(String driver) |
void |
setDryRun(boolean dryRun) |
void |
setPassWord(String passWord) |
void |
setUrl(String url) |
void |
setUserName(String userName) |
void |
setValidationServers(String servers) |
void |
setVerbose(boolean verbose) |
void |
showInfo()
Print Hive version and schema version
|
void |
verifySchemaVersion()
check if the current schema version in metastore matches the Hive version
|
public HiveSchemaTool(String dbType, String metaDbType) throws HiveMetaException
HiveMetaExceptionpublic HiveSchemaTool(String hiveHome, HiveConf hiveConf, String dbType, String metaDbType) throws HiveMetaException
HiveMetaExceptionpublic HiveConf getHiveConf()
public void setUrl(String url)
public void setDriver(String driver)
public void setUserName(String userName)
public void setPassWord(String passWord)
public void setDryRun(boolean dryRun)
public void setVerbose(boolean verbose)
public void setDbOpts(String dbOpts)
public void setValidationServers(String servers)
public void showInfo()
throws HiveMetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void verifySchemaVersion()
throws HiveMetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void doUpgrade()
throws HiveMetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void doUpgrade(String fromSchemaVer) throws HiveMetaException
fromSchemaVer - Existing version of the metastore. If null, then read from the metastoreorg.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void doInit()
throws HiveMetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void doInit(String toVersion) throws HiveMetaException
toVersion - If null then current hive version is usedorg.apache.hadoop.hive.metastore.api.MetaExceptionHiveMetaExceptionpublic void doValidate()
throws HiveMetaException
HiveMetaExceptionpublic void runBeeLine(String sqlScriptFile) throws IOException
IOExceptionpublic static void main(String[] args)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.