org.apache.calcite.util.Util.range()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中org.apache.calcite.util.Util.range()方法的一些代码示例,展示了Util.range()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.range()方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:range

Util.range介绍

暂无

代码示例

代码示例来源:origin: apache/hive

/** 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();
}

代码示例来源:origin: apache/drill

/** 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();
}

代码示例来源:origin: Qihoo360/Quicksql

protected List<Integer> getOperandList(int operandCount) {
 return nOperands == -1
   ? Util.range(0, operandCount)
   : Util.range(0, nOperands);
}

代码示例来源:origin: org.apache.calcite/calcite-core

protected List<Integer> getOperandList(int operandCount) {
 return nOperands == -1
   ? Util.range(0, operandCount)
   : Util.range(0, nOperands);
}

代码示例来源:origin: org.apache.calcite/calcite-core

/** 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();
}

代码示例来源:origin: Qihoo360/Quicksql

/** 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();
}

代码示例来源:origin: Qihoo360/Quicksql

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));
}

代码示例来源:origin: org.apache.calcite/calcite-core

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));
}

代码示例来源:origin: Qihoo360/Quicksql

push(r);
List<RexNode> predicates = new ArrayList<>();
for (int key : Util.range(groupCount)) {
 predicates.add(equals(field(2, 0, key), field(2, 1, key)));

代码示例来源:origin: org.apache.calcite/calcite-core

push(r);
List<RexNode> predicates = new ArrayList<>();
for (int key : Util.range(groupCount)) {
 predicates.add(equals(field(2, 0, key), field(2, 1, key)));

代码示例来源:origin: Qihoo360/Quicksql

factorCostOrdering.immutableSortedCopy(Util.range(nJoinFactors));

代码示例来源:origin: org.apache.calcite/calcite-core

factorCostOrdering.immutableSortedCopy(Util.range(nJoinFactors));

代码示例来源:origin: org.apache.calcite/calcite-core

- newLeftInput.getRowType().getFieldCount();
final List<Integer> rightKeys =
  Util.range(rightOffset, rightOffset + leftKeys.size());

代码示例来源:origin: org.apache.flink/flink-table_2.10

- newLeftInput.getRowType().getFieldCount();
final List<Integer> rightKeys =
  Util.range(rightOffset, rightOffset + leftKeys.size());

代码示例来源:origin: org.apache.calcite/calcite-core

return false;
for (int operand : Util.range(callBinding.getOperandCount())) {
 for (SqlOperandTypeChecker rule : allowedRules) {
  if (!((SqlSingleOperandTypeChecker) rule).checkSingleOperandType(

代码示例来源:origin: Qihoo360/Quicksql

return false;
for (int operand : Util.range(callBinding.getOperandCount())) {
 for (SqlOperandTypeChecker rule : allowedRules) {
  if (!((SqlSingleOperandTypeChecker) rule).checkSingleOperandType(

代码示例来源:origin: Qihoo360/Quicksql

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;
 }
});

代码示例来源:origin: org.apache.calcite/calcite-core

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;
 }
});

代码示例来源:origin: Qihoo360/Quicksql

@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) {

代码示例来源:origin: org.apache.calcite/calcite-core

@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) {

相关文章