PlanNode¶
PlanNode is an abstraction of nodes of a query plan.
Contract¶
Building SchemaKStream¶
SchemaKStream<?> buildStream(
PlanBuildContext buildContext)
Builds a SchemaKStream
Used when:
ExecutionPlanBuilderis requested for a PhysicalPlan- others (less important?)
Number of Partitions¶
int getPartitions(
KafkaTopicClient kafkaTopicClient)
LogicalSchema¶
LogicalSchema getSchema()
Source PlanNodes¶
List<PlanNode> getSources()
Source PlanNodes:
- No sources for DataSourceNode
- The single source of SingleSourcePlanNode
- The left and right join sources of JoinNode
Used when:
PullPhysicalPlanBuilderis requested tobuildPullPhysicalPlanPushPhysicalPlanBuilderis requested tobuildPushPhysicalPlanJoinNodeis requested to findUpstreamJoin, getPreJoinProjectDataSourcesPlanNodeis requested to getSourceNodes, resolveSelectStar, validateColumns, validateKeyPresent
Implementations¶
Creating Instance¶
PlanNode takes the following to be created:
-
PlanNodeId - DataSourceType
- Source Name
Abstract Class
PlanNode is an abstract class and cannot be created directly. It is created indirectly for the concrete PlanNodes.
DataSourceType¶
PlanNode is given a DataSourceType when created.
| DataSourceType | ksqlType |
|---|---|
| KSTREAM | STREAM |
| KTABLE | TABLE |
getSourceNodes¶
Stream<DataSourceNode> getSourceNodes()
For this PlanNode as DataSourceNode, getSourceNodes simply returns this DataSourceNode.
Otherwise, getSourceNodes takes the source PlanNodes and then their DataSourceNodes.
getSourceNodes is used when:
EngineExecutoris requested to getSourceNamesLogicalPlanneris requested to joinOnNonKeyAttributeJoinNodeis requested to getDefaultSourceKeyFormatPlanNodeis requested to getLeftmostSourceNode- a few others