org.apache.hive.beeline
Class HiveSchemaTool

java.lang.Object
  extended by org.apache.hive.beeline.HiveSchemaTool

public class HiveSchemaTool
extends Object


Constructor Summary
HiveSchemaTool(String dbType)
           
HiveSchemaTool(String hiveHome, HiveConf hiveConf, String dbType)
           
 
Method Summary
static String buildCommand(HiveSchemaHelper.NestedScriptParser dbCommandParser, String scriptDir, String scriptFile)
           
 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiveSchemaTool

public HiveSchemaTool(String dbType)
               throws HiveMetaException
Throws:
HiveMetaException

HiveSchemaTool

public HiveSchemaTool(String hiveHome,
                      HiveConf hiveConf,
                      String dbType)
               throws HiveMetaException
Throws:
HiveMetaException
Method Detail

getHiveConf

public HiveConf getHiveConf()

setUserName

public void setUserName(String userName)

setPassWord

public void setPassWord(String passWord)

setDryRun

public void setDryRun(boolean dryRun)

setVerbose

public void setVerbose(boolean verbose)

showInfo

public void showInfo()
              throws HiveMetaException
Print Hive version and schema version

Throws:
MetaException
HiveMetaException

verifySchemaVersion

public void verifySchemaVersion()
                         throws HiveMetaException
check if the current schema version in metastore matches the Hive version

Throws:
MetaException
HiveMetaException

doUpgrade

public void doUpgrade()
               throws HiveMetaException
Perform metastore schema upgrade. extract the current schema version from metastore

Throws:
MetaException
HiveMetaException

doUpgrade

public void doUpgrade(String fromSchemaVer)
               throws HiveMetaException
Perform metastore schema upgrade

Parameters:
fromSchemaVer - Existing version of the metastore. If null, then read from the metastore
Throws:
MetaException
HiveMetaException

doInit

public void doInit()
            throws HiveMetaException
Initialize the metastore schema to current version

Throws:
MetaException
HiveMetaException

doInit

public void doInit(String toVersion)
            throws HiveMetaException
Initialize the metastore schema

Parameters:
toVersion - If null then current hive version is used
Throws:
MetaException
HiveMetaException

buildCommand

public static String buildCommand(HiveSchemaHelper.NestedScriptParser dbCommandParser,
                                  String scriptDir,
                                  String scriptFile)
                           throws IllegalFormatException,
                                  IOException
Throws:
IllegalFormatException
IOException

runBeeLine

public void runBeeLine(String sqlScriptFile)
                throws IOException
Throws:
IOException

main

public static void main(String[] args)


Copyright © 2012 The Apache Software Foundation