org.apache.hadoop.hive.ql.plan
Class AlterTableDesc

java.lang.Object
  extended by org.apache.hadoop.hive.ql.plan.DDLDesc
      extended by org.apache.hadoop.hive.ql.plan.AlterTableDesc
All Implemented Interfaces:
Serializable

public class AlterTableDesc
extends DDLDesc
implements Serializable

AlterTableDesc.

See Also:
Serialized Form

Nested Class Summary
static class AlterTableDesc.AlterTableTypes
          alterTableTypes.
static class AlterTableDesc.ProtectModeType
           
 
Constructor Summary
AlterTableDesc()
           
AlterTableDesc(AlterTableDesc.AlterTableTypes alterType)
           
AlterTableDesc(AlterTableDesc.AlterTableTypes alterType, boolean expectView)
           
AlterTableDesc(String tableName, boolean sortingOff, HashMap<String,String> partSpec)
           
AlterTableDesc(String tableName, boolean turnOffSkewed, List<String> skewedColNames, List<List<String>> skewedColValues)
           
AlterTableDesc(String tableName, HashMap<String,String> partSpec, int numBuckets)
           
AlterTableDesc(String tableName, int numBuckets, List<String> bucketCols, List<org.apache.hadoop.hive.metastore.api.Order> sortCols, HashMap<String,String> partSpec)
           
AlterTableDesc(String name, List<org.apache.hadoop.hive.metastore.api.FieldSchema> newCols, AlterTableDesc.AlterTableTypes alterType)
           
AlterTableDesc(String tableName, Map<List<String>,String> locations, HashMap<String,String> partSpec)
           
AlterTableDesc(String oldName, String newName, boolean expectView)
           
AlterTableDesc(String tableName, String newLocation, HashMap<String,String> partSpec)
           
AlterTableDesc(String tblName, String oldColName, String newColName, String newType, String newComment, boolean first, String afterCol)
           
AlterTableDesc(String name, String inputFormat, String outputFormat, String serdeName, String storageHandler, HashMap<String,String> partSpec)
           
 
Method Summary
 String getAfterCol()
           
 String getAlterTableTypeString()
           
 ArrayList<String> getBucketColumns()
           
 boolean getExpectView()
           
 boolean getFirst()
           
 String getInputFormat()
           
 boolean getIsDropIfExists()
           
 String getNewColComment()
           
 String getNewColName()
           
 ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> getNewCols()
           
 List<String> getNewColsString()
           
 String getNewColType()
           
 String getNewLocation()
           
 String getNewName()
           
 int getNumberBuckets()
           
 String getOldColName()
           
 String getOldName()
           
 AlterTableDesc.AlterTableTypes getOp()
           
 String getOutputFormat()
           
 HashMap<String,String> getPartSpec()
           
 HashMap<String,String> getProps()
           
 AlterTableDesc.ProtectModeType getProtectModeType()
           
 String getSerdeName()
           
 List<String> getSkewedColNames()
           
 List<List<String>> getSkewedColValues()
           
 Map<List<String>,String> getSkewedLocations()
           
 ArrayList<org.apache.hadoop.hive.metastore.api.Order> getSortColumns()
           
 String getStorageHandler()
           
 Table getTable()
           
 boolean isProtectModeEnable()
           
 boolean isStoredAsSubDirectories()
           
 boolean isTurnOffSkewed()
           
 boolean isTurnOffSorting()
           
 void setAfterCol(String afterCol)
           
 void setBucketColumns(ArrayList<String> bucketColumns)
           
 void setDropIfExists(boolean isDropIfExists)
           
 void setExpectView(boolean expectView)
           
 void setFirst(boolean first)
           
 void setInputFormat(String inputFormat)
           
 void setNewColComment(String newComment)
           
 void setNewColName(String newColName)
           
 void setNewCols(ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> newCols)
           
 void setNewColType(String newType)
           
 void setNewLocation(String newLocation)
           
 void setNewName(String newName)
           
 void setNumberBuckets(int numberBuckets)
           
 void setOldColName(String oldColName)
           
 void setOldName(String oldName)
           
 void setOp(AlterTableDesc.AlterTableTypes op)
           
 void setOutputFormat(String outputFormat)
           
 void setPartSpec(HashMap<String,String> partSpec)
           
 void setProps(HashMap<String,String> props)
           
 void setProtectModeEnable(boolean protectModeEnable)
           
 void setProtectModeType(AlterTableDesc.ProtectModeType protectModeType)
           
 void setSerdeName(String serdeName)
           
 void setSkewedColNames(List<String> skewedColNames)
           
 void setSkewedColValues(List<List<String>> skewedColValues)
           
 void setSkewedLocations(Map<List<String>,String> skewedLocations)
           
 void setSortColumns(ArrayList<org.apache.hadoop.hive.metastore.api.Order> sortColumns)
           
 void setStorageHandler(String storageHandler)
           
 void setStoredAsSubDirectories(boolean isStoredAsSubDirectories)
           
 void setTable(Table table)
           
 void setTurnOffSkewed(boolean turnOffSkewed)
           
 void validate()
          Validate alter table description.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlterTableDesc

public AlterTableDesc()

AlterTableDesc

public AlterTableDesc(String tblName,
                      String oldColName,
                      String newColName,
                      String newType,
                      String newComment,
                      boolean first,
                      String afterCol)
Parameters:
tblName - table name
oldColName - old column name
newColName - new column name
newComment -
newType -

AlterTableDesc

public AlterTableDesc(String oldName,
                      String newName,
                      boolean expectView)
Parameters:
oldName - old name of the table
newName - new name of the table

AlterTableDesc

public AlterTableDesc(String name,
                      List<org.apache.hadoop.hive.metastore.api.FieldSchema> newCols,
                      AlterTableDesc.AlterTableTypes alterType)
Parameters:
name - name of the table
newCols - new columns to be added

AlterTableDesc

public AlterTableDesc(AlterTableDesc.AlterTableTypes alterType)
Parameters:
alterType - type of alter op

AlterTableDesc

public AlterTableDesc(AlterTableDesc.AlterTableTypes alterType,
                      boolean expectView)
Parameters:
alterType - type of alter op

AlterTableDesc

public AlterTableDesc(String name,
                      String inputFormat,
                      String outputFormat,
                      String serdeName,
                      String storageHandler,
                      HashMap<String,String> partSpec)
Parameters:
name - name of the table
inputFormat - new table input format
outputFormat - new table output format
partSpec -

AlterTableDesc

public AlterTableDesc(String tableName,
                      int numBuckets,
                      List<String> bucketCols,
                      List<org.apache.hadoop.hive.metastore.api.Order> sortCols,
                      HashMap<String,String> partSpec)

AlterTableDesc

public AlterTableDesc(String tableName,
                      boolean sortingOff,
                      HashMap<String,String> partSpec)

AlterTableDesc

public AlterTableDesc(String tableName,
                      String newLocation,
                      HashMap<String,String> partSpec)

AlterTableDesc

public AlterTableDesc(String tableName,
                      Map<List<String>,String> locations,
                      HashMap<String,String> partSpec)

AlterTableDesc

public AlterTableDesc(String tableName,
                      boolean turnOffSkewed,
                      List<String> skewedColNames,
                      List<List<String>> skewedColValues)

AlterTableDesc

public AlterTableDesc(String tableName,
                      HashMap<String,String> partSpec,
                      int numBuckets)
Method Detail

getNewColsString

public List<String> getNewColsString()

getAlterTableTypeString

public String getAlterTableTypeString()

getOldName

public String getOldName()
Returns:
the old name of the table

setOldName

public void setOldName(String oldName)
Parameters:
oldName - the oldName to set

getNewName

public String getNewName()
Returns:
the newName

setNewName

public void setNewName(String newName)
Parameters:
newName - the newName to set

getOp

public AlterTableDesc.AlterTableTypes getOp()
Returns:
the op

setOp

public void setOp(AlterTableDesc.AlterTableTypes op)
Parameters:
op - the op to set

getNewCols

public ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> getNewCols()
Returns:
the newCols

setNewCols

public void setNewCols(ArrayList<org.apache.hadoop.hive.metastore.api.FieldSchema> newCols)
Parameters:
newCols - the newCols to set

getSerdeName

public String getSerdeName()
Returns:
the serdeName

setSerdeName

public void setSerdeName(String serdeName)
Parameters:
serdeName - the serdeName to set

getProps

public HashMap<String,String> getProps()
Returns:
the props

setProps

public void setProps(HashMap<String,String> props)
Parameters:
props - the props to set

getInputFormat

public String getInputFormat()
Returns:
the input format

setInputFormat

public void setInputFormat(String inputFormat)
Parameters:
inputFormat - the input format to set

getOutputFormat

public String getOutputFormat()
Returns:
the output format

setOutputFormat

public void setOutputFormat(String outputFormat)
Parameters:
outputFormat - the output format to set

getStorageHandler

public String getStorageHandler()
Returns:
the storage handler

setStorageHandler

public void setStorageHandler(String storageHandler)
Parameters:
storageHandler - the storage handler to set

getNumberBuckets

public int getNumberBuckets()
Returns:
the number of buckets

setNumberBuckets

public void setNumberBuckets(int numberBuckets)
Parameters:
numberBuckets - the number of buckets to set

getBucketColumns

public ArrayList<String> getBucketColumns()
Returns:
the bucket columns

setBucketColumns

public void setBucketColumns(ArrayList<String> bucketColumns)
Parameters:
bucketColumns - the bucket columns to set

getSortColumns

public ArrayList<org.apache.hadoop.hive.metastore.api.Order> getSortColumns()
Returns:
the sort columns

setSortColumns

public void setSortColumns(ArrayList<org.apache.hadoop.hive.metastore.api.Order> sortColumns)
Parameters:
sortColumns - the sort columns to set

getOldColName

public String getOldColName()
Returns:
old column name

setOldColName

public void setOldColName(String oldColName)
Parameters:
oldColName - the old column name

getNewColName

public String getNewColName()
Returns:
new column name

setNewColName

public void setNewColName(String newColName)
Parameters:
newColName - the new column name

getNewColType

public String getNewColType()
Returns:
new column type

setNewColType

public void setNewColType(String newType)
Parameters:
newType - new column's type

getNewColComment

public String getNewColComment()
Returns:
new column's comment

setNewColComment

public void setNewColComment(String newComment)
Parameters:
newComment - new column's comment

getFirst

public boolean getFirst()
Returns:
if the column should be changed to position 0

setFirst

public void setFirst(boolean first)
Parameters:
first - set the column to position 0

getAfterCol

public String getAfterCol()
Returns:
the column's after position

setAfterCol

public void setAfterCol(String afterCol)
Parameters:
afterCol - set the column's after position

getExpectView

public boolean getExpectView()
Returns:
whether to expect a view being altered

setExpectView

public void setExpectView(boolean expectView)
Parameters:
expectView - set whether to expect a view being altered

getPartSpec

public HashMap<String,String> getPartSpec()
Returns:
part specification

setPartSpec

public void setPartSpec(HashMap<String,String> partSpec)
Parameters:
partSpec -

getNewLocation

public String getNewLocation()
Returns:
new location

setNewLocation

public void setNewLocation(String newLocation)
Parameters:
newLocation - new location

isProtectModeEnable

public boolean isProtectModeEnable()

setProtectModeEnable

public void setProtectModeEnable(boolean protectModeEnable)

getProtectModeType

public AlterTableDesc.ProtectModeType getProtectModeType()

setProtectModeType

public void setProtectModeType(AlterTableDesc.ProtectModeType protectModeType)

getSkewedLocations

public Map<List<String>,String> getSkewedLocations()
Returns:
the skewedLocations

setSkewedLocations

public void setSkewedLocations(Map<List<String>,String> skewedLocations)
Parameters:
skewedLocations - the skewedLocations to set

isTurnOffSorting

public boolean isTurnOffSorting()
Returns:
isTurnOffSorting

isTurnOffSkewed

public boolean isTurnOffSkewed()
Returns:
the turnOffSkewed

setTurnOffSkewed

public void setTurnOffSkewed(boolean turnOffSkewed)
Parameters:
turnOffSkewed - the turnOffSkewed to set

getSkewedColNames

public List<String> getSkewedColNames()
Returns:
the skewedColNames

setSkewedColNames

public void setSkewedColNames(List<String> skewedColNames)
Parameters:
skewedColNames - the skewedColNames to set

getSkewedColValues

public List<List<String>> getSkewedColValues()
Returns:
the skewedColValues

setSkewedColValues

public void setSkewedColValues(List<List<String>> skewedColValues)
Parameters:
skewedColValues - the skewedColValues to set

validate

public void validate()
              throws SemanticException
Validate alter table description.

Throws:
SemanticException

getTable

public Table getTable()
Returns:
the table

setTable

public void setTable(Table table)
Parameters:
table - the table to set

isStoredAsSubDirectories

public boolean isStoredAsSubDirectories()
Returns:
the isStoredAsSubDirectories

setStoredAsSubDirectories

public void setStoredAsSubDirectories(boolean isStoredAsSubDirectories)
Parameters:
isStoredAsSubDirectories - the isStoredAsSubDirectories to set

setDropIfExists

public void setDropIfExists(boolean isDropIfExists)
Parameters:
isDropIfExists - the isDropIfExists to set

getIsDropIfExists

public boolean getIsDropIfExists()
Returns:
isDropIfExists


Copyright © 2014 The Apache Software Foundation. All rights reserved.