public class HiveSchemaTool
extends java.lang.Object
| Constructor and Description |
|---|
HiveSchemaTool(java.lang.String dbType) |
HiveSchemaTool(java.lang.String hiveHome,
HiveConf hiveConf,
java.lang.String dbType) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
buildCommand(HiveSchemaHelper.NestedScriptParser dbCommandParser,
java.lang.String scriptDir,
java.lang.String scriptFile) |
void |
doInit()
Initialize the metastore schema to current version
|
void |
doInit(java.lang.String toVersion)
Initialize the metastore schema
|
void |
doUpgrade()
Perform metastore schema upgrade.
|
void |
doUpgrade(java.lang.String fromSchemaVer)
Perform metastore schema upgrade
|
HiveConf |
getHiveConf() |
static void |
main(java.lang.String[] args) |
void |
runBeeLine(java.lang.String sqlScriptFile) |
void |
setDryRun(boolean dryRun) |
void |
setPassWord(java.lang.String passWord) |
void |
setUserName(java.lang.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(java.lang.String dbType)
throws HiveMetaException
HiveMetaExceptionpublic HiveSchemaTool(java.lang.String hiveHome,
HiveConf hiveConf,
java.lang.String dbType)
throws HiveMetaException
HiveMetaExceptionpublic HiveConf getHiveConf()
public void setUserName(java.lang.String userName)
public void setPassWord(java.lang.String passWord)
public void setDryRun(boolean dryRun)
public void setVerbose(boolean verbose)
public void showInfo()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void verifySchemaVersion()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doUpgrade()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doUpgrade(java.lang.String fromSchemaVer)
throws HiveMetaException
fromSchemaVer - Existing version of the metastore. If null, then read from the metastoreMetaExceptionHiveMetaExceptionpublic void doInit()
throws HiveMetaException
MetaExceptionHiveMetaExceptionpublic void doInit(java.lang.String toVersion)
throws HiveMetaException
toVersion - If null then current hive version is usedMetaExceptionHiveMetaExceptionpublic static java.lang.String buildCommand(HiveSchemaHelper.NestedScriptParser dbCommandParser, java.lang.String scriptDir, java.lang.String scriptFile) throws java.util.IllegalFormatException, java.io.IOException
java.util.IllegalFormatExceptionjava.io.IOExceptionpublic void runBeeLine(java.lang.String sqlScriptFile)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
Copyright © 2012 The Apache Software Foundation