@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.preferArray()); return implementor.result(physType, Blocks.toBlock( Expressions.call(table.getExpression(FlowFileTable.class), "project", Expressions.constant(fields)))); }
Expressions.field(context, BuiltInMethod.CONTEXT_VALUES.field), PhysTypeImpl.of(javaTypeFactory, inputRowType, JavaRowFormat.ARRAY, false)))); final Function1<String, RexToLixTranslator.InputGetter> correlates =
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { context.setReturnTupleInfo(rowType, columnRowType); String execFunction = genExecFunc(); PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), JavaRowFormat.ARRAY); MethodCallExpression exprCall = Expressions.call(table.getExpression(OLAPTable.class), execFunction, implementor.getRootExpression(), Expressions.constant(context.id)); return implementor.result(physType, Blocks.toBlock(exprCall)); }
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { context.setReturnTupleInfo(rowType, columnRowType); PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.preferArray()); RelOptTable factTable = context.firstTableScan.getTable(); MethodCallExpression exprCall = Expressions.call(factTable.getExpression(OLAPTable.class), "executeOLAPQuery", implementor.getRootExpression(), Expressions.constant(context.id)); return implementor.result(physType, Blocks.toBlock(exprCall)); }
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); Expression unionExp = null; for (Ord<RelNode> ord : Ord.zip(inputs)) { EnumerableRel input = (EnumerableRel) ord.e; final Result result = implementor.visitChild(this, ord.i, input, pref); Expression childExp = builder.append( "child" + ord.i, result.block); if (unionExp == null) { unionExp = childExp; } else { unionExp = createUnionExpression(unionExp, childExp, result.format == JavaRowFormat.ARRAY); } } builder.add(unionExp); final PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), pref.prefer(JavaRowFormat.CUSTOM)); return implementor.result(physType, builder.toBlock()); } }
public PhysType field(int ordinal) { final RelDataTypeField field = rowType.getFieldList().get(ordinal); final RelDataType type = field.getType(); return PhysTypeImpl.of(typeFactory, toStruct(type), format, false); }
public PhysType field(int ordinal) { final RelDataTypeField field = rowType.getFieldList().get(ordinal); final RelDataType type = field.getType(); return PhysTypeImpl.of(typeFactory, toStruct(type), format, false); }
public static PhysType of( JavaTypeFactory typeFactory, RelDataType rowType, JavaRowFormat format, boolean optimize) { if (optimize) { format = format.optimize(rowType); } final Type javaRowClass = format.javaRowClass(typeFactory, rowType); return new PhysTypeImpl(typeFactory, rowType, javaRowClass, format); }
public PhysType component(int fieldOrdinal) { final RelDataTypeField field = rowType.getFieldList().get(fieldOrdinal); return PhysTypeImpl.of(typeFactory, toStruct(field.getType().getComponentType()), format, false); }
public static PhysType of( JavaTypeFactory typeFactory, RelDataType rowType, JavaRowFormat format, boolean optimize) { if (optimize) { format = format.optimize(rowType); } final Type javaRowClass = format.javaRowClass(typeFactory, rowType); return new PhysTypeImpl(typeFactory, rowType, javaRowClass, format); }
public PhysType component(int fieldOrdinal) { final RelDataTypeField field = rowType.getFieldList().get(fieldOrdinal); return PhysTypeImpl.of(typeFactory, toStruct(field.getType().getComponentType()), format, false); }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Note that representation is ARRAY. This assumes that the table // returns a Object[] for each record. Actually a Table<T> can // return any type T. And, if it is a JdbcTable, we'd like to be // able to generate alternate accessors that return e.g. synthetic // records {T0 f0; T1 f1; ...} and don't box every primitive value. final PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), format()); final Expression expression = getExpression(physType); return implementor.result(physType, Blocks.toBlock(expression)); } }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Note that representation is ARRAY. This assumes that the table // returns a Object[] for each record. Actually a Table<T> can // return any type T. And, if it is a JdbcTable, we'd like to be // able to generate alternate accessors that return e.g. synthetic // records {T0 f0; T1 f1; ...} and don't box every primitive value. final PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), format()); final Expression expression = getExpression(physType); return implementor.result(physType, Blocks.toBlock(expression)); } }
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.preferArray()); return implementor.result(physType, Blocks.toBlock( Expressions.call(table.getExpression(FlowFileTable.class), "project", Expressions.constant(fields)))); }
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { context.setReturnTupleInfo(rowType, columnRowType); String execFunction = genExecFunc(); PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), JavaRowFormat.ARRAY); MethodCallExpression exprCall = Expressions.call(table.getExpression(OLAPTable.class), execFunction, implementor.getRootExpression(), Expressions.constant(context.id)); return implementor.result(physType, Blocks.toBlock(exprCall)); }
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { context.setReturnTupleInfo(rowType, columnRowType); PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.preferArray()); RelOptTable factTable = context.firstTableScan.getTable(); MethodCallExpression exprCall = Expressions.call(factTable.getExpression(OLAPTable.class), "executeOLAPQuery", implementor.getRootExpression(), Expressions.constant(context.id)); return implementor.result(physType, Blocks.toBlock(exprCall)); }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), pref.preferArray()); return implementor.result( physType, Blocks.toBlock( Expressions.call(table.getExpression(QuarkTileTable.class), "project", Expressions.constant( QuarkEnumerator.identityList(getRowType().getFieldCount()))))); }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), pref.preferArray()); return implementor.result( physType, Blocks.toBlock( Expressions.call(table.getExpression(QuarkTable.class), "project", Expressions.constant(QuarkEnumerator.identityList( getRowType().getFieldCount()))))); }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final PhysType physType = PhysTypeImpl.of(typeFactory, getRowType(), JavaRowFormat.ARRAY); final Expression interpreter_ = builder.append("interpreter", Expressions.new_(Interpreter.class, implementor.getRootExpression(), implementor.stash(getInput(), RelNode.class))); final Expression sliced_ = getRowType().getFieldCount() == 1 ? Expressions.call(BuiltInMethod.SLICE0.method, interpreter_) : interpreter_; builder.add(sliced_); return implementor.result(physType, builder.toBlock()); } }
public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final PhysType physType = PhysTypeImpl.of(typeFactory, getRowType(), JavaRowFormat.ARRAY); final Expression interpreter_ = builder.append("interpreter", Expressions.new_(Interpreter.class, implementor.getRootExpression(), implementor.stash(getInput(), RelNode.class))); final Expression sliced_ = getRowType().getFieldCount() == 1 ? Expressions.call(BuiltInMethod.SLICE0.method, interpreter_) : interpreter_; builder.add(sliced_); return implementor.result(physType, builder.toBlock()); } }