public class HCatTable extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HCatTable.TableAttribute
Attributes that can be compared between HCatTables.
|
static class |
HCatTable.Type |
Modifier and Type | Field and Description |
---|---|
static EnumSet<HCatTable.TableAttribute> |
DEFAULT_COMPARISON_ATTRIBUTES
The default set of attributes that can be diffed between HCatTables.
|
static String |
DEFAULT_INPUT_FORMAT_CLASS |
static String |
DEFAULT_OUTPUT_FORMAT_CLASS |
static String |
DEFAULT_SERDE_CLASS |
static EnumSet<HCatTable.TableAttribute> |
NO_DIFF
2 HCatTables are considered equivalent if
lhs.diff(rhs).equals(NO_DIFF) == true; |
Constructor and Description |
---|
HCatTable(String dbName,
String tableName) |
Modifier and Type | Method and Description |
---|---|
HCatTable |
bucketCols(List<String> bucketCols)
Setter for list of bucket columns.
|
HCatTable |
collectionItemsTerminatedBy(char delimiter)
See row_format element of CREATE_TABLE DDL for Hive.
|
HCatTable |
cols(List<HCatFieldSchema> cols)
Setter for Column schemas.
|
String |
comment() |
HCatTable |
comment(String comment)
Setter for table-level comment.
|
HCatTable |
dbName(String dbName)
Setter for db-name.
|
EnumSet<HCatTable.TableAttribute> |
diff(HCatTable rhs)
Method to compare the attributes of 2 HCatTable instances.
|
EnumSet<HCatTable.TableAttribute> |
diff(HCatTable rhs,
EnumSet<HCatTable.TableAttribute> attributesToCheck)
Method to compare the attributes of 2 HCatTable instances.
|
HCatTable |
escapeChar(char escapeChar)
See row_format element of CREATE_TABLE DDL for Hive.
|
HCatTable |
fieldsTerminatedBy(char delimiter)
See row_format element of CREATE_TABLE DDL for Hive.
|
String |
fileFormat() |
HCatTable |
fileFormat(String fileFormat) |
List<String> |
getBucketCols()
Gets the bucket columns.
|
List<HCatFieldSchema> |
getCols()
Gets the columns.
|
String |
getDbName()
Gets the db name.
|
String |
getInputFileFormat()
Gets the input file format.
|
String |
getLocation()
Gets the location.
|
int |
getNumBuckets()
Gets the number of buckets.
|
String |
getOutputFileFormat()
Gets the output file format.
|
List<HCatFieldSchema> |
getPartCols()
Gets the part columns.
|
String |
getSerdeLib()
Gets the serde lib.
|
Map<String,String> |
getSerdeParams()
Returns parameters such as field delimiter,etc.
|
List<Order> |
getSortCols()
Gets the sort columns.
|
String |
getStorageHandler()
Gets the storage handler.
|
String |
getTableName()
Gets the table name.
|
String |
getTabletype()
Gets the tableType.
|
Map<String,String> |
getTblProps()
Gets the table props.
|
HCatTable |
inputFileFormat(String inputFileFormat)
Setter for InputFormat class.
|
HCatTable |
linesTerminatedBy(char delimiter)
See row_format element of CREATE_TABLE DDL for Hive.
|
HCatTable |
location(String location)
Setter for location.
|
HCatTable |
mapKeysTerminatedBy(char delimiter)
See row_format element of CREATE_TABLE DDL for Hive.
|
HCatTable |
nullDefinedAs(char nullChar)
See row_format element of CREATE_TABLE DDL for Hive.
|
HCatTable |
numBuckets(int numBuckets)
Setter for number of buckets.
|
HCatTable |
outputFileFormat(String outputFileFormat)
Setter for OutputFormat class.
|
String |
owner()
Getter for table-owner.
|
HCatTable |
owner(String owner)
Setter for table-owner.
|
HCatTable |
partCol(HCatFieldSchema partCol)
Setter for individual partition columns.
|
HCatTable |
partCols(List<HCatFieldSchema> partCols)
Setter for list of partition columns.
|
HCatTable |
resolve(HCatTable rhs,
EnumSet<HCatTable.TableAttribute> attributes)
Method to "adopt" the specified attributes from rhs into this HCatTable object.
|
HCatTable |
serdeLib(String serde)
Setter for SerDe class name.
|
HCatTable |
serdeParam(String paramName,
String value) |
HCatTable |
serdeParams(Map<String,String> serdeParams) |
HCatTable |
sortCols(List<Order> sortCols)
Setter for Sort-cols.
|
HCatTable |
storageHandler(String storageHandler)
Setter for StorageHandler class.
|
HCatTable |
tableName(String tableName)
Setter for TableName.
|
HCatTable |
tableType(HCatTable.Type tableType)
Setter for table-type.
|
HCatTable |
tblProps(Map<String,String> tblProps)
Setter for TableProperty map.
|
String |
toString() |
public static final EnumSet<HCatTable.TableAttribute> DEFAULT_COMPARISON_ATTRIBUTES
public static final EnumSet<HCatTable.TableAttribute> NO_DIFF
lhs.diff(rhs).equals(NO_DIFF) == true;
public static final String DEFAULT_SERDE_CLASS
public static final String DEFAULT_INPUT_FORMAT_CLASS
public static final String DEFAULT_OUTPUT_FORMAT_CLASS
public String getTableName()
public String getDbName()
public List<HCatFieldSchema> getCols()
public HCatTable cols(List<HCatFieldSchema> cols)
public List<HCatFieldSchema> getPartCols()
public HCatTable partCols(List<HCatFieldSchema> partCols)
public HCatTable partCol(HCatFieldSchema partCol)
public List<String> getBucketCols()
public int getNumBuckets()
public HCatTable numBuckets(int numBuckets)
public String getStorageHandler()
public HCatTable storageHandler(String storageHandler) throws HCatException
HCatException
public String getTabletype()
public HCatTable tableType(HCatTable.Type tableType)
public String fileFormat()
public String getInputFileFormat()
public HCatTable inputFileFormat(String inputFileFormat)
public String getOutputFileFormat()
public HCatTable outputFileFormat(String outputFileFormat)
public String getSerdeLib()
public Map<String,String> getSerdeParams()
public String getLocation()
public String owner()
public String comment()
public HCatTable fieldsTerminatedBy(char delimiter)
public HCatTable escapeChar(char escapeChar)
public HCatTable collectionItemsTerminatedBy(char delimiter)
public HCatTable mapKeysTerminatedBy(char delimiter)
public HCatTable linesTerminatedBy(char delimiter)
public HCatTable nullDefinedAs(char nullChar)
public EnumSet<HCatTable.TableAttribute> diff(HCatTable rhs, EnumSet<HCatTable.TableAttribute> attributesToCheck)
rhs
- The other table being compared against. Can't be null.attributesToCheck
- The list of TableAttributes being compared.EnumSet<TableAttribute>
containing all the attribute that differ between this
and rhs.
Subset of attributesToCheck
.public EnumSet<HCatTable.TableAttribute> diff(HCatTable rhs)
DEFAULT_COMPARISON_ATTRIBUTES
are compared.rhs
- The other table being compared against. Can't be null.EnumSet<TableAttribute>
containing all the attribute that differ between this
and rhs.
Subset of DEFAULT_COMPARISON_ATTRIBUTES
.public HCatTable resolve(HCatTable rhs, EnumSet<HCatTable.TableAttribute> attributes) throws HCatException
rhs
- The "source" table from which attributes are to be copied from.attributes
- The set of attributes to be copied from rhs. Usually the result of this.diff(rhs)
.HCatException
Copyright © 2017 The Apache Software Foundation. All rights reserved.