关注 spark技术分享,
撸spark源码 玩spark最佳实践

EventTimeWatermark Unary Logical Operator

EventTimeWatermark Unary Logical Operator

EventTimeWatermark is a unary logical operator (i.e. UnaryNode) that is created as the result of withWatermark operator.

EventTimeWatermark uses spark.watermarkDelayMs key (in the Metadata of the output attributes) to hold the event-time watermark delay (as a so-called watermark attribute or eventTime watermark).

Note
The event-time watermark delay is used to calculate the difference between the event time of an event (that is modeled as a row in the Dataset for a streaming batch) and the time in the past.
Note

EliminateEventTimeWatermark logical optimization rule (i.e. Rule[LogicalPlan]) removes EventTimeWatermark logical operator from a logical plan if child logical operator is not streaming, i.e. when withWatermark operator is used on a batch query.

Note
EventTimeWatermark is converted (aka planned) to EventTimeWatermarkExec physical operator in StatefulAggregationStrategy execution planning strategy.

output Property

Note
output is part of the QueryPlan Contract to describe the attributes of (the schema of) the output.

output finds eventTime column in the output schema of the child logical operator and updates the Metadata of the column with spark.watermarkDelayMs key and the milliseconds for the delay.

output removes spark.watermarkDelayMs key from the other columns.

Creating EventTimeWatermark Instance

EventTimeWatermark takes the following when created:

  • Event time column

  • Delay CalendarInterval

  • Child logical operator

赞(0) 打赏
未经允许不得转载:spark技术分享 » EventTimeWatermark Unary Logical Operator
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏