ExpandExec Physical Operator¶
ExpandExec
is a unary physical operator with support for Whole-Stage Java Code Generation.
Creating Instance¶
ExpandExec
takes the following to be created:
- Projection Expressions (
Seq[Seq[Expression]]
) - Output Attributes
- Child physical operator
ExpandExec
is created when:
- BasicOperators execution planning strategy is executed (to plan a Expand logical operator)
Performance Metrics¶
number of output rows¶
Generating Java Source Code for Consume Path¶
CodegenSupport
doConsume(
ctx: CodegenContext,
input: Seq[ExprCode],
row: ExprCode): String
doConsume
is part of the CodegenSupport abstraction.
doConsume
...FIXME
Generating Java Source Code for Produce Path¶
CodegenSupport
doProduce(
ctx: CodegenContext): String
doProduce
is part of the CodegenSupport abstraction.
doProduce
requests the child operator (that is supposed to be a CodegenSupport physical operator) to generate a Java source code for produce code path.
Executing Operator¶
doExecute
requests the child operator to execute (that creates a RDD[InternalRow]
).
doExecute
uses RDD.mapPartitions
operator to apply a function to each partition of the RDD[InternalRow]
.
doExecute
...FIXME
needCopyResult¶
needCopyResult
is always enabled (true
).
canPassThrough¶
ExpandExec
canPassThrough in RemoveRedundantProjects physical optimization.
Demo¶
FIXME
- Create an plan with
ExpandExec
- Access the operator
- Request it to produce the consume path code