Class ColumnStatsWatermarkExtractor
- java.lang.Object
-
- org.apache.iceberg.flink.source.reader.ColumnStatsWatermarkExtractor
-
- All Implemented Interfaces:
java.io.Serializable
,SplitWatermarkExtractor
@Internal public class ColumnStatsWatermarkExtractor extends java.lang.Object implements SplitWatermarkExtractor, java.io.Serializable
SplitWatermarkExtractor
implementation which uses an Iceberg timestamp column statistics to get the watermarks for theIcebergSourceSplit
. This watermark is emitted by theWatermarkExtractorRecordEmitter
along with the actual records.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ColumnStatsWatermarkExtractor(Schema schema, java.lang.String eventTimeFieldName, java.util.concurrent.TimeUnit timeUnit)
Creates the extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
extractWatermark(IcebergSourceSplit split)
Get the watermark for a split using column statistics.
-
-
-
Constructor Detail
-
ColumnStatsWatermarkExtractor
public ColumnStatsWatermarkExtractor(Schema schema, java.lang.String eventTimeFieldName, java.util.concurrent.TimeUnit timeUnit)
Creates the extractor.- Parameters:
schema
- The schema of the TableeventTimeFieldName
- The column which should be used as an event timetimeUnit
- Used for converting the long value to epoch milliseconds
-
-
Method Detail
-
extractWatermark
public long extractWatermark(IcebergSourceSplit split)
Get the watermark for a split using column statistics.- Specified by:
extractWatermark
in interfaceSplitWatermarkExtractor
- Parameters:
split
- The split- Returns:
- The watermark
- Throws:
java.lang.IllegalArgumentException
- if there is no statistics for the column
-
-