Class SelectedCellTableSchema

java.lang.Object
io.github.flink.gcp.connector.bigtable.table.SelectedCellTableSchema

@Internal public final class SelectedCellTableSchema extends Object
The physical primary key, the value-format payload and the commit columns of a selected-cell table.

The commit columns are physical rather than metadata columns on purpose. Reading a metadata column of an upsert source makes the Flink planner keep a ChangelogNormalize operator, which completes a key-only delete from the last row it holds, so the delete carries the commit timestamp of the change it deletes. Flink 2.x drops that operator when the query reads only physical columns, and a delete then reaches the sink with its own commit timestamp and tie breaker (#1960).

  • Method Details

    • of

      public static SelectedCellTableSchema of(org.apache.flink.table.types.DataType physicalDataType, int[] primaryKeyIndexes, @Nullable String commitTimestampColumn, @Nullable String tieBreakerColumn)
      Derives the format payload by removing the one declared primary-key field and the named commit columns.
      Parameters:
      commitTimestampColumn - the physical column the source fills with the mutation's commit timestamp, or null for none
      tieBreakerColumn - the physical column the source fills with the mutation's tie breaker, or null for none
    • getPhysicalDataType

      public org.apache.flink.table.types.DataType getPhysicalDataType()
    • getPayloadDataType

      public org.apache.flink.table.types.DataType getPayloadDataType()
    • getPrimaryKeyIndex

      public int getPrimaryKeyIndex()
    • getPrimaryKeyType

      public org.apache.flink.table.types.logical.LogicalType getPrimaryKeyType()
    • getPayloadPhysicalIndexes

      public int[] getPayloadPhysicalIndexes()
      Returns the physical position of each payload field, in payload order.
    • getCommitTimestampIndex

      public int getCommitTimestampIndex()
      Returns the physical position of the commit-timestamp column, or -1 for none.
    • getTieBreakerIndex

      public int getTieBreakerIndex()
      Returns the physical position of the tie-breaker column, or -1 for none.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object