@Internal public class HBaseTableSchema extends Object implements Serializable
Constructor and Description |
---|
HBaseTableSchema() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(String family,
String qualifier,
Class<?> clazz)
Adds a column defined by family, qualifier, and type to the table schema.
|
void |
addColumn(String family,
String qualifier,
DataType type) |
DataType |
convertToDataType()
Converts this
HBaseTableSchema to DataType , the fields are consisted of
families and rowkey, the order is in the definition order (i.e. |
boolean |
equals(Object o) |
static HBaseTableSchema |
fromDataType(DataType physicalRowType)
Construct a
HBaseTableSchema from a DataType . |
byte[][] |
getFamilyKeys()
Returns the HBase identifiers of all registered column families.
|
String[] |
getFamilyNames()
Returns the names of all registered column families.
|
DataType[] |
getQualifierDataTypes(String family) |
byte[][] |
getQualifierKeys(String family)
Returns the HBase identifiers of all registered column qualifiers for a specific column
family.
|
String[] |
getQualifierNames(String family)
Returns the names of all registered column qualifiers of a specific column family.
|
Optional<DataType> |
getRowKeyDataType() |
int |
getRowKeyIndex()
Returns field index of row key in the table schema.
|
Optional<String> |
getRowKeyName()
Returns optional value of row key name.
|
Optional<TypeInformation<?>> |
getRowKeyTypeInfo()
Returns the optional type information of row key.
|
int |
hashCode() |
void |
setCharset(String charset)
Sets the charset for value strings and HBase identifiers.
|
void |
setRowKey(String rowKeyName,
Class<?> clazz)
Sets row key information in the table schema.
|
void |
setRowKey(String rowKeyName,
DataType type) |
public void addColumn(String family, String qualifier, Class<?> clazz)
family
- the family namequalifier
- the qualifier nameclazz
- the data type of the qualifierpublic void setRowKey(String rowKeyName, Class<?> clazz)
rowKeyName
- the row key field nameclazz
- the data type of the row keypublic void setCharset(String charset)
charset
- the charset for value strings and HBase identifiers.public String[] getFamilyNames()
public byte[][] getFamilyKeys()
public String[] getQualifierNames(String family)
family
- The name of the column family for which the column qualifier names are
returned.public byte[][] getQualifierKeys(String family)
family
- The name of the column family for which the column qualifier identifiers are
returned.public int getRowKeyIndex()
public Optional<TypeInformation<?>> getRowKeyTypeInfo()
public Optional<String> getRowKeyName()
public DataType convertToDataType()
HBaseTableSchema
to DataType
, the fields are consisted of
families and rowkey, the order is in the definition order (i.e. calling addColumn(String, String, Class)
and setRowKey(String, Class)
). The family field
is a composite type which is consisted of qualifiers.DataType
derived from the HBaseTableSchema
.public static HBaseTableSchema fromDataType(DataType physicalRowType)
HBaseTableSchema
from a DataType
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.