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
HiveMetaException
public HiveSchemaTool(String hiveHome, HiveConf hiveConf, String dbType) throws HiveMetaException
HiveMetaException
public 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
MetaException
HiveMetaException
public void verifySchemaVersion() throws HiveMetaException
MetaException
HiveMetaException
public void doUpgrade() throws HiveMetaException
MetaException
HiveMetaException
public void doUpgrade(String fromSchemaVer) throws HiveMetaException
fromSchemaVer
- Existing version of the metastore. If null, then read from the metastoreMetaException
HiveMetaException
public void doInit() throws HiveMetaException
MetaException
HiveMetaException
public void doInit(String toVersion) throws HiveMetaException
toVersion
- If null then current hive version is usedMetaException
HiveMetaException
public void runBeeLine(String sqlScriptFile) throws IOException
IOException
public static void main(String[] args)
Copyright © 2017 The Apache Software Foundation. All rights reserved.