StreamingRelationV2 Leaf Logical Operator¶
StreamingRelationV2 is a leaf logical operator that represents SupportsRead streaming tables (with MICRO_BATCH_READ or CONTINUOUS_READ capabilities) in a logical plan of a streaming query.
Tip
Learn more about Leaf Logical Operators, SupportsRead and Table Capabilities in The Internals of Spark SQL online book.
Creating Instance¶
StreamingRelationV2 takes the following to be created:
-
TableProvider(Spark SQL) - Source Name
-
Table(Spark SQL) - Extra Options
- Output Attributes (Spark SQL)
- StreamingRelation
-
SparkSession(Spark SQL)
StreamingRelationV2 is created when:
DataStreamReaderis reqested to load data (for aSupportsReadtable withMICRO_BATCH_READorCONTINUOUS_READcapabilities)MemoryStreamBaseis requested for a logical query plan
Logical Resolution¶
StreamingRelationV2 is resolved to the following leaf logical operators:
- StreamingDataSourceV2Relation or StreamingExecutionRelation when
MicroBatchExecutionstream execution engine is requested for an analyzed logical plan - StreamingDataSourceV2Relation when
ContinuousExecutionstream execution engine is created (and initializes an analyzed logical plan)