Class BigtableTableSchema
java.lang.Object
io.github.flink.gcp.connector.bigtable.table.BigtableTableSchema
The DDL schema of a
bigtable table: which column is the row key, and which column family
and qualifier every other column addresses.
The model is the HBase connector's, so that a table definition moves between the two with its schema intact:
Abbreviated, not compiled: deployment-specific connector options are omitted.
CREATE TABLE bt (
rowkey STRING,
cf1 ROW<qual1 STRING, qual2 BIGINT>,
cf2 ROW<metric DOUBLE>,
PRIMARY KEY (rowkey) NOT ENFORCED
) WITH ('connector' = 'bigtable', ...)
Exactly one column is not a ROW and that column is the row key; every ROW
column is a column family whose nested field names are the qualifiers. Upstream
google/flink-connector-gcp's alternative — a value.format per family — was weighed and
declined on #34: it
cannot give a single qualifier its own type, and it ties a family to a format.
Column order is preserved, because it is what a projection's indexes refer to.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne column family: aROWcolumn whose nested fields are its qualifiers.static final classOne qualifier: a nested field of a column family'sROW. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the column families, in DDL order.intReturns the physical row's field count: its row key and its column families.intReturns the position of the row-key column in the physical row.Returns the name of the row-key column.org.apache.flink.table.types.logical.LogicalTypeReturns the declared type of the row-key column.inthashCode()static BigtableTableSchemaof(org.apache.flink.table.types.logical.RowType rowType) Reads the model out of a table's physical row type.
-
Method Details
-
of
Reads the model out of a table's physical row type.- Parameters:
rowType- the physical columns, in DDL order- Returns:
- the parsed schema
- Throws:
org.apache.flink.table.api.ValidationException- if the columns do not describe one row key and zero or more column families, or if a column's type has no cell encoding
-
getRowKeyIndex
public int getRowKeyIndex()Returns the position of the row-key column in the physical row. -
getRowKeyName
Returns the name of the row-key column. -
getRowKeyType
public org.apache.flink.table.types.logical.LogicalType getRowKeyType()Returns the declared type of the row-key column. -
getFamilies
Returns the column families, in DDL order. -
getFieldCount
public int getFieldCount()Returns the physical row's field count: its row key and its column families. -
equals
-
hashCode
public int hashCode()
-