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:
DataStreamReader
is reqested to load data (for aSupportsRead
table withMICRO_BATCH_READ
orCONTINUOUS_READ
capabilities)MemoryStreamBase
is requested for a logical query plan
Logical Resolution¶
StreamingRelationV2
is resolved to the following leaf logical operators:
- StreamingDataSourceV2Relation or StreamingExecutionRelation when
MicroBatchExecution
stream execution engine is requested for an analyzed logical plan - StreamingDataSourceV2Relation when
ContinuousExecution
stream execution engine is created (and initializes an analyzed logical plan)