Package org.apache.calcite.rex
Class RexExecutorImpl
- java.lang.Object
-
- org.apache.calcite.rex.RexExecutorImpl
-
- All Implemented Interfaces:
RexExecutor
public class RexExecutorImpl extends java.lang.Object implements RexExecutor
Evaluates aRexNode
expression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RexExecutorImpl.DataContextInputGetter
Implementation ofRexToLixTranslator.InputGetter
that reads the values of input fields by calling
.DataContext.get(java.lang.String)
("inputRecord")
-
Field Summary
Fields Modifier and Type Field Description private DataContext
dataContext
-
Constructor Summary
Constructors Constructor Description RexExecutorImpl(DataContext dataContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
compile(RexBuilder rexBuilder, java.util.List<RexNode> constExps, RexToLixTranslator.InputGetter getter)
private java.lang.String
compile(RexBuilder rexBuilder, java.util.List<RexNode> constExps, RexToLixTranslator.InputGetter getter, RelDataType rowType)
RexExecutable
getExecutable(RexBuilder rexBuilder, java.util.List<RexNode> exps, RelDataType rowType)
Creates anRexExecutable
that allows to apply the generated code during query processing (filter, projection).void
reduce(RexBuilder rexBuilder, java.util.List<RexNode> constExps, java.util.List<RexNode> reducedValues)
Do constant reduction using generated code.
-
-
-
Field Detail
-
dataContext
private final DataContext dataContext
-
-
Constructor Detail
-
RexExecutorImpl
public RexExecutorImpl(DataContext dataContext)
-
-
Method Detail
-
compile
private java.lang.String compile(RexBuilder rexBuilder, java.util.List<RexNode> constExps, RexToLixTranslator.InputGetter getter)
-
compile
private java.lang.String compile(RexBuilder rexBuilder, java.util.List<RexNode> constExps, RexToLixTranslator.InputGetter getter, RelDataType rowType)
-
getExecutable
public RexExecutable getExecutable(RexBuilder rexBuilder, java.util.List<RexNode> exps, RelDataType rowType)
Creates anRexExecutable
that allows to apply the generated code during query processing (filter, projection).- Parameters:
rexBuilder
- Rex builderexps
- ExpressionsrowType
- describes the structure of the input row.
-
reduce
public void reduce(RexBuilder rexBuilder, java.util.List<RexNode> constExps, java.util.List<RexNode> reducedValues)
Do constant reduction using generated code.- Specified by:
reduce
in interfaceRexExecutor
- Parameters:
rexBuilder
- Rex builderconstExps
- Expressions to be reducedreducedValues
- List to which reduced expressions are appended
-
-