/** Returns references to the fields of a given input. */ public ImmutableList<RexNode> fields(int inputCount, int inputOrdinal) { final RelNode input = peek(inputCount, inputOrdinal); final RelDataType rowType = input.getRowType(); final ImmutableList.Builder<RexNode> nodes = ImmutableList.builder(); for (int fieldOrdinal : Util.range(rowType.getFieldCount())) { nodes.add(field(inputCount, inputOrdinal, fieldOrdinal)); } return nodes.build(); }
/** Returns references to the fields of a given input. */ public ImmutableList<RexNode> fields(int inputCount, int inputOrdinal) { final RelNode input = peek(inputCount, inputOrdinal); final RelDataType rowType = input.getRowType(); final ImmutableList.Builder<RexNode> nodes = ImmutableList.builder(); for (int fieldOrdinal : Util.range(rowType.getFieldCount())) { nodes.add(field(inputCount, inputOrdinal, fieldOrdinal)); } return nodes.build(); }
/** Returns references to the fields of a given input. */ public ImmutableList<RexNode> fields(int inputCount, int inputOrdinal) { final RelNode input = peek(inputCount, inputOrdinal); final RelDataType rowType = input.getRowType(); final ImmutableList.Builder<RexNode> nodes = ImmutableList.builder(); for (int fieldOrdinal : Util.range(rowType.getFieldCount())) { nodes.add(field(inputCount, inputOrdinal, fieldOrdinal)); } return nodes.build(); }
/** Returns references to the fields of a given input. */ public ImmutableList<RexNode> fields(int inputCount, int inputOrdinal) { final RelNode input = peek(inputCount, inputOrdinal); final RelDataType rowType = input.getRowType(); final ImmutableList.Builder<RexNode> nodes = ImmutableList.builder(); for (int fieldOrdinal : Util.range(rowType.getFieldCount())) { nodes.add(field(inputCount, inputOrdinal, fieldOrdinal)); } return nodes.build(); }
public Expression convertTo(Expression exp, PhysType targetPhysType) { final JavaRowFormat targetFormat = targetPhysType.getFormat(); if (format == targetFormat) { return exp; } final ParameterExpression o_ = Expressions.parameter(javaRowClass, "o"); final int fieldCount = rowType.getFieldCount(); return Expressions.call(exp, BuiltInMethod.SELECT.method, generateSelector(o_, Util.range(fieldCount), targetFormat)); }
public Expression convertTo(Expression exp, PhysType targetPhysType) { final JavaRowFormat targetFormat = targetPhysType.getFormat(); if (format == targetFormat) { return exp; } final ParameterExpression o_ = Expressions.parameter(javaRowClass, "o"); final int fieldCount = rowType.getFieldCount(); return Expressions.call(exp, BuiltInMethod.SELECT.method, generateSelector(o_, Util.range(fieldCount), targetFormat)); }
push(r); List<RexNode> predicates = new ArrayList<>(); for (int key : Util.range(groupCount)) { predicates.add(equals(field(2, 0, key), field(2, 1, key)));
push(r); List<RexNode> predicates = new ArrayList<>(); for (int key : Util.range(groupCount)) { predicates.add(equals(field(2, 0, key), field(2, 1, key)));
factorCostOrdering.immutableSortedCopy(Util.range(nJoinFactors));
factorCostOrdering.immutableSortedCopy(Util.range(nJoinFactors));
- newLeftInput.getRowType().getFieldCount(); final List<Integer> rightKeys = Util.range(rightOffset, rightOffset + leftKeys.size());
- newLeftInput.getRowType().getFieldCount(); final List<Integer> rightKeys = Util.range(rightOffset, rightOffset + leftKeys.size());
return false; for (int operand : Util.range(callBinding.getOperandCount())) { for (SqlOperandTypeChecker rule : allowedRules) { if (!((SqlSingleOperandTypeChecker) rule).checkSingleOperandType(
return false; for (int operand : Util.range(callBinding.getOperandCount())) { for (SqlOperandTypeChecker rule : allowedRules) { if (!((SqlSingleOperandTypeChecker) rule).checkSingleOperandType(
protected RexNode handle(RexFieldAccess fieldAccess) { final RexCorrelVariable v = (RexCorrelVariable) fieldAccess.getReferenceExpr(); if (v.id.equals(correlation) && v.getType().getFieldCount() == mapping.getSourceCount()) { final int old = fieldAccess.getField().getIndex(); final int new_ = mapping.getTarget(old); final RelDataTypeFactory.Builder typeBuilder = relBuilder.getTypeFactory().builder(); for (int target : Util.range(mapping.getTargetCount())) { typeBuilder.add( v.getType().getFieldList().get(mapping.getSource(target))); } final RexNode newV = rexBuilder.makeCorrel(typeBuilder.build(), v.id); if (old != new_) { return rexBuilder.makeFieldAccess(newV, new_); } } return fieldAccess; } });
protected RexNode handle(RexFieldAccess fieldAccess) { final RexCorrelVariable v = (RexCorrelVariable) fieldAccess.getReferenceExpr(); if (v.id.equals(correlation) && v.getType().getFieldCount() == mapping.getSourceCount()) { final int old = fieldAccess.getField().getIndex(); final int new_ = mapping.getTarget(old); final RelDataTypeFactory.Builder typeBuilder = relBuilder.getTypeFactory().builder(); for (int target : Util.range(mapping.getTargetCount())) { typeBuilder.add( v.getType().getFieldList().get(mapping.getSource(target))); } final RexNode newV = rexBuilder.makeCorrel(typeBuilder.build(), v.id); if (old != new_) { return rexBuilder.makeFieldAccess(newV, new_); } } return fieldAccess; } });
@Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) { final RelDataTypeFactory typeFactory = opBinding.getTypeFactory(); final RelDataTypeFactory.Builder builder = typeFactory.builder(); for (Integer operand : Util.range(opBinding.getOperandCount())) { RelDataType type = opBinding.getOperandType(operand); if (type.getSqlTypeName() == SqlTypeName.ANY) {
@Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) { final RelDataTypeFactory typeFactory = opBinding.getTypeFactory(); final RelDataTypeFactory.Builder builder = typeFactory.builder(); for (Integer operand : Util.range(opBinding.getOperandCount())) { RelDataType type = opBinding.getOperandType(operand); if (type.getSqlTypeName() == SqlTypeName.ANY) {