PlanNode¶
PlanNode
is an abstraction of nodes of a query plan.
Contract¶
Building SchemaKStream¶
SchemaKStream<?> buildStream(
PlanBuildContext buildContext)
Builds a SchemaKStream
Used when:
ExecutionPlanBuilder
is 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:
PullPhysicalPlanBuilder
is requested tobuildPullPhysicalPlan
PushPhysicalPlanBuilder
is requested tobuildPushPhysicalPlan
JoinNode
is requested to findUpstreamJoin, getPreJoinProjectDataSourcesPlanNode
is 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 DataSourceNode
s.
getSourceNodes
is used when:
EngineExecutor
is requested to getSourceNamesLogicalPlanner
is requested to joinOnNonKeyAttributeJoinNode
is requested to getDefaultSourceKeyFormatPlanNode
is requested to getLeftmostSourceNode- a few others