Search in sources :

Example 1 with InputGetter

use of org.apache.calcite.adapter.enumerable.RexToLixTranslator.InputGetter in project calcite by apache.

the class RexExecutorImpl method getExecutable.

/**
 * Creates an {@link RexExecutable} that allows to apply the
 * generated code during query processing (filter, projection).
 *
 * @param rexBuilder Rex builder
 * @param exps Expressions
 * @param rowType describes the structure of the input row.
 */
public RexExecutable getExecutable(RexBuilder rexBuilder, List<RexNode> exps, RelDataType rowType) {
    final JavaTypeFactoryImpl typeFactory = new JavaTypeFactoryImpl(rexBuilder.getTypeFactory().getTypeSystem());
    final InputGetter getter = new DataContextInputGetter(rowType, typeFactory);
    final String code = compile(rexBuilder, exps, getter, rowType);
    return new RexExecutable(code, "generated Rex code");
}
Also used : InputGetter(org.apache.calcite.adapter.enumerable.RexToLixTranslator.InputGetter) JavaTypeFactoryImpl(org.apache.calcite.jdbc.JavaTypeFactoryImpl)

Aggregations

InputGetter (org.apache.calcite.adapter.enumerable.RexToLixTranslator.InputGetter)1 JavaTypeFactoryImpl (org.apache.calcite.jdbc.JavaTypeFactoryImpl)1