Class PortableBigQueryDestinations

  • All Implemented Interfaces:
    java.io.Serializable

    @Internal
    public class PortableBigQueryDestinations
    extends DynamicDestinations<org.apache.beam.sdk.values.Row,​java.lang.String>
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DESTINATION  
      static java.lang.String RECORD  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.beam.sdk.transforms.SerializableFunction<AvroWriteRequest<org.apache.beam.sdk.values.Row>,​org.apache.avro.generic.GenericRecord> getAvroFilterFormatFunction​(boolean fetchNestedRecord)  
      java.lang.String getDestination​(@Nullable org.apache.beam.sdk.values.ValueInSingleWindow<org.apache.beam.sdk.values.Row> element)
      Returns an object that represents at a high level which table is being written to.
      org.apache.beam.sdk.transforms.SerializableFunction<org.apache.beam.sdk.values.Row,​com.google.api.services.bigquery.model.TableRow> getFilterFormatFunction​(boolean fetchNestedRecord)  
      @Nullable com.google.api.services.bigquery.model.TableSchema getSchema​(java.lang.String destination)
      Returns the table schema for the destination.
      TableDestination getTable​(java.lang.String destination)
      Returns a TableDestination object for the destination.
      @Nullable com.google.api.services.bigquery.model.TableConstraints getTableConstraints​(java.lang.String destination)
      Returns TableConstraints (including primary and foreign key) to be used when creating the table.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PortableBigQueryDestinations

        public PortableBigQueryDestinations​(org.apache.beam.sdk.schemas.Schema rowSchema,
                                            BigQueryWriteConfiguration configuration)
    • Method Detail

      • getDestination

        public java.lang.String getDestination​(@Nullable org.apache.beam.sdk.values.ValueInSingleWindow<org.apache.beam.sdk.values.Row> element)
        Description copied from class: DynamicDestinations
        Returns an object that represents at a high level which table is being written to. May not return null.

        The method must return a unique object for different destination tables involved over all BigQueryIO write transforms in the same pipeline. See https://github.com/apache/beam/issues/32335 for details.

        Specified by:
        getDestination in class DynamicDestinations<org.apache.beam.sdk.values.Row,​java.lang.String>
      • getSchema

        public @Nullable com.google.api.services.bigquery.model.TableSchema getSchema​(java.lang.String destination)
        Description copied from class: DynamicDestinations
        Returns the table schema for the destination.
        Specified by:
        getSchema in class DynamicDestinations<org.apache.beam.sdk.values.Row,​java.lang.String>
      • getTableConstraints

        public @Nullable com.google.api.services.bigquery.model.TableConstraints getTableConstraints​(java.lang.String destination)
        Description copied from class: DynamicDestinations
        Returns TableConstraints (including primary and foreign key) to be used when creating the table. Note: this is not currently supported when using FILE_LOADS!.
        Overrides:
        getTableConstraints in class DynamicDestinations<org.apache.beam.sdk.values.Row,​java.lang.String>
      • getFilterFormatFunction

        public org.apache.beam.sdk.transforms.SerializableFunction<org.apache.beam.sdk.values.Row,​com.google.api.services.bigquery.model.TableRow> getFilterFormatFunction​(boolean fetchNestedRecord)
      • getAvroFilterFormatFunction

        public org.apache.beam.sdk.transforms.SerializableFunction<AvroWriteRequest<org.apache.beam.sdk.values.Row>,​org.apache.avro.generic.GenericRecord> getAvroFilterFormatFunction​(boolean fetchNestedRecord)