CodegenContext
CodegenContext
is…FIXME
CodegenContext
takes no input parameters.
CodegenContext
is created when:
-
WholeStageCodegenExec
physical operator is requested to generate a Java source code for the child operator (whenWholeStageCodegenExec
is executed) -
CodeGenerator
is requested for a new CodegenContext -
GenerateUnsafeRowJoiner
is requested for aUnsafeRowJoiner
CodegenContext
stores expressions that don’t support codegen.
Name | Description |
---|---|
|
Mutable Scala New entries are added when Used when |
|
Expressions are added and then fetched as equivalent sets when |
|
|
|
|
|
Placeholders and their comments Used when…FIXME |
|
|
|
Used when…FIXME |
|
Generating Java Source Code For Code-Generated Evaluation of Multiple Expressions (With Optional Subexpression Elimination) — generateExpressions
Method
(only with subexpression elimination enabled) generateExpressions
does subexpressionElimination of the input expressions
.
In the end, generateExpressions
requests every expressions to generate the Java source code for code-generated (non-interpreted) expression evaluation.
Note
|
|
subexpressionEliminationForWholeStageCodegen
Method
subexpressionEliminationForWholeStageCodegen
…FIXME
Note
|
subexpressionEliminationForWholeStageCodegen is used exclusively when HashAggregateExec is requested to generate a Java source code for whole-stage consume path (with grouping keys or not).
|
Adding Function to Generated Class — addNewFunction
Method
addNewFunction
…FIXME
Note
|
addNewFunction is used when…FIXME
|
subexpressionElimination
Internal Method
subexpressionElimination
requests EquivalentExpressions to addExprTree for every expression (in the input expressions
).
subexpressionElimination
requests EquivalentExpressions for the equivalent sets of expressions with at least two equivalent expressions (aka common expressions).
For every equivalent expression set, subexpressionElimination
does the following:
-
Takes the first expression and requests it to generate a Java source code for the expression tree
-
addNewFunction and adds it to subexprFunctions
-
Creates a
SubExprEliminationState
and adds it with every common expression in the equivalent expression set to subExprEliminationExprs
Note
|
subexpressionElimination is used exclusively when CodegenContext is requested to generateExpressions (with subexpression elimination enabled).
|
Adding Mutable State — addMutableState
Method
addMutableState
…FIXME
Note
|
addMutableState is used when…FIXME
|
Adding Immutable State (Unless Exists Already) — addImmutableStateIfNotExists
Method
addImmutableStateIfNotExists
…FIXME
Note
|
addImmutableStateIfNotExists is used when…FIXME
|
addNewFunctionToClass
Internal Method
addNewFunctionToClass
…FIXME
Note
|
addNewFunctionToClass is used when…FIXME
|
declareAddedFunctions
Method
declareAddedFunctions
…FIXME
Note
|
declareAddedFunctions is used when…FIXME
|