Class SchemaUpdateOptions

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

@Public public final class SchemaUpdateOptions extends Object implements Serializable
Options gating connector-driven destination table schema updates.

When the serializer's schema (from BigQueryProtoSerializationSchema.getTableSchema(io.github.flink.gcp.connector.bigquery.sink.TableDestination)) evolves past the destination table's schema, the sink can update the table itself via the BigQuery API before continuing to write. The update is a union: existing table fields are never dropped or reordered, new fields are appended, and field type changes are always rejected. What the union may change is gated by these flags:

Both flags default to off, in which case the sink never modifies table schemas (schema changes made externally — for example via DDL — are still picked up reactively). Enabling updates requires the bigquery.tables.get and bigquery.tables.update permissions.

Schema unionization is deliberately opt-in: BigQuery columns can never be dropped again, so a single malformed record shipping an unexpected field could otherwise poison a table permanently.

Instances are immutable and serializable. Use defaults() to keep updates disabled.

See Also:
  • Method Details

    • defaults

      public static SchemaUpdateOptions defaults()
      Returns options with connector-driven schema updates disabled.
    • builder

      public static SchemaUpdateOptions.Builder builder()
      Returns:
      a new builder
    • isAllowNewFields

      public boolean isAllowNewFields()
      Returns whether missing serializer fields may be appended to the table.
    • isAllowFieldRelaxation

      public boolean isAllowFieldRelaxation()
      Returns whether REQUIRED table fields may be relaxed to NULLABLE.
    • isEnabled

      public boolean isEnabled()
      Returns whether any connector-driven schema update is enabled.
    • 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