public class RowDataContinuousDeltaSourceBuilder
extends <any>
DeltaSource
for a stream of RowData
where the created source
instance will operate in Continuous mode.
In Continuous mode, the DeltaSource
will, by default, load the full state of the latest
table version, and then start monitoring for changes. If you use either the
startingVersion(java.lang.String)
or
startingTimestamp(java.lang.String)
APIs, then the DeltaSource
will start monitoring for changes from that historical version. It will not load the full table
state at that historical table version.
For most common use cases use DeltaSource.forContinuousRowData(org.apache.flink.core.fs.Path, org.apache.hadoop.conf.Configuration)
utility method to
instantiate the source. After instantiation of this builder you can either call RowDataBoundedDeltaSourceBuilder.build()
method to get the instance of a DeltaSource
or
configure additional options using builder's API.
Modifier and Type | Method and Description |
---|---|
DeltaSource<org.apache.flink.table.data.RowData> |
build()
Creates an instance of
DeltaSource for a stream of RowData . |
RowDataContinuousDeltaSourceBuilder |
columnNames(java.util.List<String> columnNames)
Specifies a
List of column names that should be read from Delta table. |
RowDataContinuousDeltaSourceBuilder |
columnNames(String... columnNames)
Specifies an array of column names that should be read from Delta table.
|
RowDataContinuousDeltaSourceBuilder |
ignoreChanges(boolean ignoreChanges)
Sets the "ignoreChanges" option.
|
RowDataContinuousDeltaSourceBuilder |
ignoreDeletes(boolean ignoreDeletes)
Sets the "ignoreDeletes" option.
|
RowDataContinuousDeltaSourceBuilder |
option(String optionName,
boolean optionValue)
Sets a configuration option.
|
RowDataContinuousDeltaSourceBuilder |
option(String optionName,
int optionValue)
Sets a configuration option.
|
RowDataContinuousDeltaSourceBuilder |
option(String optionName,
long optionValue)
Sets a configuration option.
|
RowDataContinuousDeltaSourceBuilder |
option(String optionName,
String optionValue)
Sets a configuration option.
|
RowDataContinuousDeltaSourceBuilder |
startingTimestamp(String startingTimestamp)
Sets value of "startingTimestamp" option.
|
RowDataContinuousDeltaSourceBuilder |
startingVersion(long startingVersion)
Sets value of "startingVersion" option.
|
RowDataContinuousDeltaSourceBuilder |
startingVersion(String startingVersion)
Sets value of "startingVersion" option.
|
RowDataContinuousDeltaSourceBuilder |
updateCheckIntervalMillis(long updateCheckInterval)
Sets the value for "updateCheckIntervalMillis" option.
|
public RowDataContinuousDeltaSourceBuilder columnNames(java.util.List<String> columnNames)
List
of column names that should be read from Delta table. If this method
is not used, Source will read all columns from Delta table.
If provided List is null or contains null, empty or blank elements it will throw a
DeltaSourceValidationException
by builder after calling build()
method.
columnNames
- column names that should be read.public RowDataContinuousDeltaSourceBuilder columnNames(String... columnNames)
If provided List is null or contains null, empty or blank elements it will throw a
DeltaSourceValidationException
by builder after calling build()
method.
columnNames
- column names that should be read.public RowDataContinuousDeltaSourceBuilder startingVersion(String startingVersion)
This option is mutually exclusive with startingTimestamp(String)
option.
startingVersion
- Delta table version to start reading changes from. The values can be
string numbers like "1", "10" etc. or keyword "latest", where in that
case, changes from the latest Delta table version will be read.public RowDataContinuousDeltaSourceBuilder startingVersion(long startingVersion)
This option is mutually exclusive with startingTimestamp(String)
option.
startingVersion
- Delta table version to start reading changes from.public RowDataContinuousDeltaSourceBuilder startingTimestamp(String startingTimestamp)
This option is mutually exclusive with startingVersion(String)
and startingVersion(long)
option.
startingTimestamp
- The timestamp of the table from which we start reading changes.
Supported formats are:
public RowDataContinuousDeltaSourceBuilder updateCheckIntervalMillis(long updateCheckInterval)
The default value for this option is 5000 ms.
updateCheckInterval
- The update check internal in milliseconds.public RowDataContinuousDeltaSourceBuilder ignoreDeletes(boolean ignoreDeletes)
The default value for this option is false.
public RowDataContinuousDeltaSourceBuilder ignoreChanges(boolean ignoreChanges)
Note that setting this option to true can lead to duplicate processing of data, as, in the case of updates, existing rows may be rewritten in new files, and those new files will be treated as new data and be fully reprocessed.
This option subsumes ignoreDeletes(boolean)
option. Therefore, if you set "ignoreChanges" to
true, your stream will not be disrupted by either deletions or updates to the source table.
The default value for this option is false.
public RowDataContinuousDeltaSourceBuilder option(String optionName, String optionValue)
optionName
- Option name to set.optionValue
- Option String
value to set.public RowDataContinuousDeltaSourceBuilder option(String optionName, boolean optionValue)
optionName
- Option name to set.optionValue
- Option boolean value to set.public RowDataContinuousDeltaSourceBuilder option(String optionName, int optionValue)
optionName
- Option name to set.optionValue
- Option int value to set.public RowDataContinuousDeltaSourceBuilder option(String optionName, long optionValue)
optionName
- Option name to set.optionValue
- Option long value to set.public DeltaSource<org.apache.flink.table.data.RowData> build()
DeltaSource
for a stream of RowData
. Created source
will work in Continuous mode, actively monitoring Delta table for new changes.
This method can throw DeltaSourceValidationException
in case of invalid arguments
passed to Delta source builder.
DeltaSource
instance.