Package org.apache.beam.sdk.io.jdbc
Class JdbcIO.Read<T>
- 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.Read<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- JdbcIO
public abstract static class JdbcIO.Read<T> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>Implementation ofJdbcIO.read().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Read()
-
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.Read<T>withCoder(org.apache.beam.sdk.coders.Coder<T> coder)Deprecated.JdbcIOis able to infer appropriate coders from other parameters.JdbcIO.Read<T>withDataSourceConfiguration(JdbcIO.DataSourceConfiguration config)JdbcIO.Read<T>withDataSourceProviderFn(org.apache.beam.sdk.transforms.SerializableFunction<java.lang.Void,javax.sql.DataSource> dataSourceProviderFn)JdbcIO.Read<T>withDisableAutoCommit(boolean disableAutoCommit)Whether to disable auto commit on read.JdbcIO.Read<T>withFetchSize(int fetchSize)This method is used to set the size of the data that is going to be fetched and loaded in memory per every database call.JdbcIO.Read<T>withOutputParallelization(boolean outputParallelization)Whether to reshuffle the resulting PCollection so results are distributed to all workers.JdbcIO.Read<T>withQuery(java.lang.String query)JdbcIO.Read<T>withQuery(org.apache.beam.sdk.options.ValueProvider<java.lang.String> query)JdbcIO.Read<T>withRowMapper(JdbcIO.RowMapper<T> rowMapper)JdbcIO.Read<T>withStatementPreparator(JdbcIO.StatementPreparator statementPreparator)-
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.Read<T> withDataSourceConfiguration(JdbcIO.DataSourceConfiguration config)
-
withDataSourceProviderFn
public JdbcIO.Read<T> withDataSourceProviderFn(org.apache.beam.sdk.transforms.SerializableFunction<java.lang.Void,javax.sql.DataSource> dataSourceProviderFn)
-
withQuery
public JdbcIO.Read<T> withQuery(java.lang.String query)
-
withQuery
public JdbcIO.Read<T> withQuery(org.apache.beam.sdk.options.ValueProvider<java.lang.String> query)
-
withStatementPreparator
public JdbcIO.Read<T> withStatementPreparator(JdbcIO.StatementPreparator statementPreparator)
-
withRowMapper
public JdbcIO.Read<T> withRowMapper(JdbcIO.RowMapper<T> rowMapper)
-
withCoder
@Deprecated public JdbcIO.Read<T> withCoder(org.apache.beam.sdk.coders.Coder<T> coder)
Deprecated.JdbcIOis able to infer appropriate coders from other parameters.
-
withFetchSize
public JdbcIO.Read<T> withFetchSize(int fetchSize)
This method is used to set the size of the data that is going to be fetched and loaded in memory per every database call. Please refer to:Statement.setFetchSize(int)It should ONLY be used if the default value throws memory errors.
-
withOutputParallelization
public JdbcIO.Read<T> withOutputParallelization(boolean outputParallelization)
Whether to reshuffle the resulting PCollection so results are distributed to all workers. The default is to parallelize and should only be changed if this is known to be unnecessary.
-
withDisableAutoCommit
public JdbcIO.Read<T> 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.
-
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>>
-
-