Package org.apache.beam.sdk.io.jdbc
Class JdbcIO.ReadWithPartitions<T,PartitionColumnT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>
-
- org.apache.beam.sdk.io.jdbc.JdbcIO.ReadWithPartitions<T,PartitionColumnT>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- JdbcIO
public abstract static class JdbcIO.ReadWithPartitions<T,PartitionColumnT> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>Implementation ofJdbcIO.readWithPartitions(org.apache.beam.sdk.values.TypeDescriptor<PartitionColumnT>).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReadWithPartitions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<T>expand(org.apache.beam.sdk.values.PBegin input)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)JdbcIO.ReadWithPartitions<T,PartitionColumnT>withCoder(org.apache.beam.sdk.coders.Coder<T> coder)Deprecated.JdbcIOis able to infer appropriate coders from other parameters.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withDataSourceConfiguration(JdbcIO.DataSourceConfiguration config)JdbcIO.ReadWithPartitions<T,PartitionColumnT>withDataSourceProviderFn(org.apache.beam.sdk.transforms.SerializableFunction<java.lang.Void,javax.sql.DataSource> dataSourceProviderFn)JdbcIO.ReadWithPartitions<T,PartitionColumnT>withDisableAutoCommit(boolean disableAutoCommit)Whether to disable auto commit on read.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withFetchSize(int fetchSize)The number of rows to fetch from the database in the sameResultSetround-trip.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withLowerBound(PartitionColumnT lowerBound)JdbcIO.ReadWithPartitions<T,PartitionColumnT>withNumPartitions(int numPartitions)The number of partitions.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withPartitionColumn(java.lang.String partitionColumn)The name of a column of numeric type that will be used for partitioning.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withRowMapper(JdbcIO.RowMapper<T> rowMapper)JdbcIO.ReadWithPartitions<T,PartitionColumnT>withRowOutput()Data output type isRow, and schema is auto-inferred from the database.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withTable(java.lang.String tableName)Name of the table in the external database.JdbcIO.ReadWithPartitions<T,PartitionColumnT>withUpperBound(PartitionColumnT upperBound)-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
withDataSourceConfiguration
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withDataSourceConfiguration(JdbcIO.DataSourceConfiguration config)
-
withDataSourceProviderFn
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withDataSourceProviderFn(org.apache.beam.sdk.transforms.SerializableFunction<java.lang.Void,javax.sql.DataSource> dataSourceProviderFn)
-
withRowMapper
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withRowMapper(JdbcIO.RowMapper<T> rowMapper)
-
withCoder
@Deprecated public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withCoder(org.apache.beam.sdk.coders.Coder<T> coder)
Deprecated.JdbcIOis able to infer appropriate coders from other parameters.
-
withNumPartitions
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withNumPartitions(int numPartitions)
The number of partitions. This, along with withLowerBound and withUpperBound, form partitions strides for generated WHERE clause expressions used to split the column withPartitionColumn evenly. When the input is less than 1, the number is set to 1.
-
withPartitionColumn
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withPartitionColumn(java.lang.String partitionColumn)
The name of a column of numeric type that will be used for partitioning.
-
withFetchSize
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withFetchSize(int fetchSize)
The number of rows to fetch from the database in the sameResultSetround-trip.
-
withDisableAutoCommit
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withDisableAutoCommit(boolean disableAutoCommit)
Whether to disable auto commit on read. Defaults to true if not provided. The need for this config varies depending on the database platform. Informix requires this to be set to false while Postgres requires this to be set to true.
-
withRowOutput
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withRowOutput()
Data output type isRow, and schema is auto-inferred from the database.
-
withLowerBound
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withLowerBound(PartitionColumnT lowerBound)
-
withUpperBound
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withUpperBound(PartitionColumnT upperBound)
-
withTable
public JdbcIO.ReadWithPartitions<T,PartitionColumnT> withTable(java.lang.String tableName)
Name of the table in the external database. Can be used to pass a user-defined subqery.
-
expand
public org.apache.beam.sdk.values.PCollection<T> expand(org.apache.beam.sdk.values.PBegin input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>
-
-