public class HiveSchemaTool extends Object
| Constructor and Description |
|---|
HiveSchemaTool(String dbType) |
HiveSchemaTool(String hiveHome,
HiveConf hiveConf,
String dbType) |
| 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
|
HiveConf |
getHiveConf() |
static void |
main(String[] args) |
void |
runBeeLine(String sqlScriptFile) |
void |
setDbOpts(String dbOpts) |
void |
setDryRun(boolean dryRun) |
void |
setPassWord(String passWord) |
void |
setUserName(String userName) |
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) throws HiveMetaException
HiveMetaExceptionpublic HiveSchemaTool(String hiveHome, HiveConf hiveConf, String dbType) throws HiveMetaException
HiveMetaExceptionpublic HiveConf getHiveConf()
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 showInfo()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void verifySchemaVersion()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doUpgrade()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doUpgrade(String fromSchemaVer) throws HiveMetaException
fromSchemaVer - Existing version of the metastore. If null, then read from the metastoreMetaExceptionHiveMetaExceptionpublic void doInit()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doInit(String toVersion) throws HiveMetaException
toVersion - If null then current hive version is usedMetaExceptionHiveMetaExceptionpublic void runBeeLine(String sqlScriptFile) throws IOException
IOExceptionpublic static void main(String[] args)
Copyright © 2017 The Apache Software Foundation. All rights reserved.