Class TableDestination

java.lang.Object
io.github.flink.gcp.connector.bigquery.sink.DestinationResolution
io.github.flink.gcp.connector.bigquery.sink.TableDestination
All Implemented Interfaces:
Serializable

@Public public final class TableDestination extends DestinationResolution implements Serializable
A fully-qualified BigQuery table reference: project, dataset and table.

Instances are pure table identity: equals(Object) and hashCode() are defined over exactly (project, dataset, table) so the class can serve as a per-destination key (writer caches, connection routing). Per-destination creation metadata (partitioning, clustering) is intentionally not part of this class — it is supplied through TableCreateOptionsProvider — keeping destination identity stable.

Instances are immutable; the resource path and hash are precomputed, so they are cheap to use as map keys on the per-record write path. Resolvers should still cache and reuse instances instead of re-creating them per record.

See Also:
  • Method Details

    • of

      public static TableDestination of(String project, String dataset, String table)
      Creates a TableDestination from bare ids, not resource paths.
      Parameters:
      project - the Google Cloud project id
      dataset - the BigQuery dataset id
      table - the BigQuery table id
      Returns:
      the destination
      Throws:
      IllegalArgumentException - if a component is null or blank, has leading or trailing whitespace, or contains '/' — a separator would make the composed resource path address a different resource
    • getProject

      public String getProject()
      Returns the Google Cloud project id, given as a bare id rather than a resource path.
    • getDataset

      public String getDataset()
      Returns the BigQuery dataset id, given as a bare id rather than a resource path.
    • getTable

      public String getTable()
      Returns the BigQuery table id, given as a bare id rather than a resource path.
    • toTablePath

      public String toTablePath()
      Returns the table path in the projects/<p>/datasets/<d>/tables/<t> form used by the BigQuery Storage API.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object