Package org.apache.drill.exec.expr
Class EvaluationVisitor.VectorVariableHolder
java.lang.Object
org.apache.drill.exec.expr.ClassGenerator.HoldingContainer
org.apache.drill.exec.expr.EvaluationVisitor.VectorVariableHolder
- Enclosing class:
- EvaluationVisitor
Extended variable descriptor ("holding container") for the variable
which references the value holder ("FooHolder") that stores the value
from a value vector. Used to pass along the original value vector
variable along with the value holder. In particular, this class allows
"time travel": to retroactively generate a reader for a union once
we realize we need the reader.
TODO: This is not especially elegant. But the code that declares the
holder/reader does not know about the parameter(s) that will use it,
and the normal HoldingContainer
can hold only one variable,
not a broader context. This version holds more context. Perhaps this
idea should be generalized.
-
Constructor Summary
ConstructorDescriptionVectorVariableHolder
(ClassGenerator.HoldingContainer base, ClassGenerator<?> classGen, com.sun.codemodel.JBlock vvSetupBlock, com.sun.codemodel.JExpression vectorExpr, com.sun.codemodel.JExpression recordIndex) -
Method Summary
Modifier and TypeMethodDescriptioncom.sun.codemodel.JVar
Specialized hack for the UNION type to obtain aFieldReader
directly from the value vector, bypassing theUnionHolder
created from that vector.Methods inherited from class org.apache.drill.exec.expr.ClassGenerator.HoldingContainer
f, getHolder, getIsSet, getMajorType, getMinorType, getValue, isConstant, isOptional, isReader, isRepeated, isSingularRepeated, setConstant, toString
-
Constructor Details
-
VectorVariableHolder
public VectorVariableHolder(ClassGenerator.HoldingContainer base, ClassGenerator<?> classGen, com.sun.codemodel.JBlock vvSetupBlock, com.sun.codemodel.JExpression vectorExpr, com.sun.codemodel.JExpression recordIndex)
-
-
Method Details
-
generateUnionReader
public com.sun.codemodel.JVar generateUnionReader()Specialized hack for the UNION type to obtain aFieldReader
directly from the value vector, bypassing theUnionHolder
created from that vector. Handles setting the reader position only once in an eval block rather than on each reference. There may be multiple functions that need the reader. To ensure we create only one common reader, we "go back in time" to add the reader at the point after we declared theUnionHolder
.
-