Class SnowflakeIO.Read<T>

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PBegin,PCollection<T>>
org.apache.beam.sdk.io.snowflake.SnowflakeIO.Read<T>
All Implemented Interfaces:
Serializable, HasDisplayData
Enclosing class:
SnowflakeIO

public abstract static class SnowflakeIO.Read<T> extends PTransform<PBegin,PCollection<T>>
Implementation of SnowflakeIO.read().
See Also:
  • Constructor Details

    • Read

      public Read()
  • Method Details

    • withDataSourceConfiguration

      public SnowflakeIO.Read<T> withDataSourceConfiguration(SnowflakeIO.DataSourceConfiguration config)
      Setting information about Snowflake server.
      Parameters:
      config - An instance of SnowflakeIO.DataSourceConfiguration.
    • withDataSourceProviderFn

      public SnowflakeIO.Read<T> withDataSourceProviderFn(SerializableFunction<Void,DataSource> dataSourceProviderFn)
      Setting function that will provide SnowflakeIO.DataSourceConfiguration in runtime.
      Parameters:
      dataSourceProviderFn - a SerializableFunction.
    • fromQuery

      public SnowflakeIO.Read<T> fromQuery(String query)
      A query to be executed in Snowflake.
      Parameters:
      query - String with query.
    • fromQuery

      public SnowflakeIO.Read<T> fromQuery(ValueProvider<String> query)
    • fromTable

      public SnowflakeIO.Read<T> fromTable(String table)
      A table name to be read in Snowflake.
      Parameters:
      table - String with the name of the table.
    • fromTable

      public SnowflakeIO.Read<T> fromTable(ValueProvider<String> table)
    • withStagingBucketName

      public SnowflakeIO.Read<T> withStagingBucketName(String stagingBucketName)
      Name of the cloud bucket (GCS by now) to use as tmp location of CSVs during COPY statement.
      Parameters:
      stagingBucketName - String with the name of the bucket.
    • withStagingBucketName

      public SnowflakeIO.Read<T> withStagingBucketName(ValueProvider<String> stagingBucketName)
    • withStorageIntegrationName

      public SnowflakeIO.Read<T> withStorageIntegrationName(String integrationName)
      Name of the Storage Integration in Snowflake to be used. See https://docs.snowflake.com/en/sql-reference/sql/create-storage-integration.html for reference.
      Parameters:
      integrationName - String with the name of the Storage Integration.
    • withStorageIntegrationName

      public SnowflakeIO.Read<T> withStorageIntegrationName(ValueProvider<String> integrationName)
    • withCsvMapper

      public SnowflakeIO.Read<T> withCsvMapper(SnowflakeIO.CsvMapper<T> csvMapper)
      User-defined function mapping CSV lines into user data.
      Parameters:
      csvMapper - an instance of SnowflakeIO.CsvMapper.
    • withCoder

      public SnowflakeIO.Read<T> withCoder(Coder<T> coder)
      A Coder to be used by the output PCollection generated by the source.
      Parameters:
      coder - an instance of Coder.
    • withQuotationMark

      public SnowflakeIO.Read<T> withQuotationMark(String quotationMark)
      Sets Snowflake-specific quotations around strings.
      Parameters:
      quotationMark - with possible single quote ', double quote " or nothing. Default value is single quotation '.
      Returns:
    • withQuotationMark

      public SnowflakeIO.Read<T> withQuotationMark(ValueProvider<String> quotationMark)
    • expand

      public PCollection<T> expand(PBegin input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PBegin,PCollection<T>>
    • populateDisplayData

      public void populateDisplayData(DisplayData.Builder builder)
      Description copied from class: PTransform
      Register display data for the given transform or component.

      populateDisplayData(DisplayData.Builder) is invoked by Pipeline runners to collect display data via DisplayData.from(HasDisplayData). Implementations may call super.populateDisplayData(builder) in order to register display data in the current namespace, but should otherwise use subcomponent.populateDisplayData(builder) to use the namespace of the subcomponent.

      By default, does not register any display data. Implementors may override this method to provide their own display data.

      Specified by:
      populateDisplayData in interface HasDisplayData
      Overrides:
      populateDisplayData in class PTransform<PBegin,PCollection<T>>
      Parameters:
      builder - The builder to populate with display data.
      See Also: