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

StreamingExecutionRelation Leaf Logical Operator for Streaming Source At Execution

StreamingExecutionRelation Leaf Logical Operator for Streaming Source At Execution

StreamingExecutionRelation is a leaf logical operator (i.e. LogicalPlan) that represents a streaming source in the logical query plan of a streaming Dataset.

The main use of StreamingExecutionRelation logical operator is to be a “placeholder” in a logical query plan that will be replaced with the real relation (with new data that has arrived since the last batch) or an empty LocalRelation when StreamExecution runs a single streaming batch.

StreamingExecutionRelation is created for a StreamingRelation in analyzed logical query plan (that is the execution representation of a streaming Dataset).

Note

Right after StreamExecution has started running streaming batches it initializes the streaming sources by transforming the analyzed logical plan of the streaming Dataset so that every StreamingRelation logical operator is replaced by the corresponding StreamingExecutionRelation.

StreamingExecutionRelation.png
Figure 1. StreamingExecutionRelation Represents Streaming Source At Execution
Note
StreamingExecutionRelation is also resolved (aka planned) to a StreamingRelationExec physical operator in StreamingRelationStrategy execution planning strategy only when explaining a streaming Dataset.

Creating StreamingExecutionRelation Instance

StreamingExecutionRelation takes the following when created:

Creating StreamingExecutionRelation (for MemoryStream Source) — apply Factory Method

apply creates a StreamingExecutionRelation for the input source and with the attributes of the schema of the source.

Note
apply is used exclusively when MemoryStream is created (and the logical plan initialized).
赞(0) 打赏
未经允许不得转载:spark技术分享 » StreamingExecutionRelation Leaf Logical Operator for Streaming Source At Execution
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏