@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) |
TableSchema |
convertsToTableSchema()
Converts this
HBaseTableSchema to TableSchema , the fields are consisted of
families and rowkey, the order is in the definition order (i.e. |
static HBaseTableSchema |
fromTableSchema(TableSchema schema)
Construct a
HBaseTableSchema from a TableSchema . |
byte[][] |
getFamilyKeys()
Returns the HBase identifiers of all registered column families.
|
String[] |
getFamilyNames()
Returns the names of all registered column families.
|
HBaseTableSchema |
getProjectedHBaseTableSchema(int[] projectedFields)
Gets a new hbase schema with the selected fields.
|
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.
|
TypeInformation<?>[] |
getQualifierTypes(String family)
Returns the types 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.
|
String |
getStringCharset()
Returns the charset for value strings and HBase identifiers.
|
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 TypeInformation<?>[] getQualifierTypes(String family)
family
- The name of the column family for which the column qualifier types are
returned.public String getStringCharset()
public int getRowKeyIndex()
public Optional<TypeInformation<?>> getRowKeyTypeInfo()
public Optional<String> getRowKeyName()
public HBaseTableSchema getProjectedHBaseTableSchema(int[] projectedFields)
public TableSchema convertsToTableSchema()
HBaseTableSchema
to TableSchema
, 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.TableSchema
derived from the HBaseTableSchema
.public static HBaseTableSchema fromTableSchema(TableSchema schema)
HBaseTableSchema
from a TableSchema
.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.