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
HiveMetaException
public HiveSchemaTool(String hiveHome, HiveConf hiveConf, String dbType, String metaDbType) throws HiveMetaException
HiveMetaException
public 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
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 doValidate() throws HiveMetaException
HiveMetaException
public void runBeeLine(String sqlScriptFile) throws IOException
IOException
public static void main(String[] args)
Copyright © 2022 The Apache Software Foundation. All rights reserved.