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

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

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

Util.discard介绍

[英]Does nothing with its argument. Call this method when you have a value you are not interested in, but you don't want the compiler to warn that you are not using it.
[中]它的论点毫无用处。当你有一个你不感兴趣的值,但你不想让编译器警告你没有使用它时,调用这个方法。

代码示例

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

public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) {
  final SqlQualified fqId = scope.fullyQualify(id);
  if (expandColumnReferences) {
    // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its
    // own ideas about qualification.
    id.assignNamesFrom(fqId.identifier);
  } else {
    Util.discard(fqId);
  }
}

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

public SqlNode validate(SqlNode topNode) {
  SqlValidatorScope scope = new EmptyScope(this);
  scope = new CatalogScope(scope, ImmutableList.of("CATALOG"));
  final SqlNode topNode2 = validateScopedExpression(topNode, scope);
  final RelDataType type = getValidatedNodeType(topNode2);
  Util.discard(type);
  return topNode2;
}

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

/** Checks that all pattern variables within a function are the same,
 * and canonizes expressions such as {@code PREV(B.price)} to
 * {@code LAST(B.price, 0)}. */
private SqlNode navigationInDefine(SqlNode node, String alpha) {
  Set<String> prefix = node.accept(new PatternValidator(false));
  Util.discard(prefix);
  node = new NavigationExpander().go(node);
  node = new NavigationReplacer(alpha).go(node);
  return node;
}

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

private SqlNode navigationInMeasure(SqlNode node, boolean allRows) {
  final Set<String> prefix = node.accept(new PatternValidator(true));
  Util.discard(prefix);
  final List<SqlNode> ops = ((SqlCall) node).getOperandList();
  final SqlOperator defaultOp =
    allRows ? SqlStdOperatorTable.RUNNING : SqlStdOperatorTable.FINAL;
  final SqlNode op0 = ops.get(0);
  if (!isRunningOrFinal(op0.getKind())
    || !allRows && op0.getKind() == SqlKind.RUNNING) {
    SqlNode newNode = defaultOp.createCall(SqlParserPos.ZERO, op0);
    node = SqlStdOperatorTable.AS.createCall(SqlParserPos.ZERO, newNode, ops.get(1));
  }
  node = new NavigationExpander().go(node);
  return node;
}

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

Util.discard(values);

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

public RelJsonReader(RelOptCluster cluster, RelOptSchema relOptSchema,
  Schema schema) {
 this.cluster = cluster;
 this.relOptSchema = relOptSchema;
 Util.discard(schema);
}

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

/**
 * Does nothing with its argument. Call this method when you have a value
 * you are not interested in, but you don't want the compiler to warn that
 * you are not using it.
 */
public static void discard(int i) {
 if (false) {
  discard(i);
 }
}

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

public static void init(RelOptPlanner planner) {
  // we can't convert from any conventions, therefore no rules to register
  Util.discard(planner);
 }
}

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

@Deprecated // to be removed before 2.0
protected Calc(
  RelOptCluster cluster,
  RelTraitSet traits,
  RelNode child,
  RexProgram program,
  List<RelCollation> collationList) {
 this(cluster, traits, child, program);
 Util.discard(collationList);
}

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

@Deprecated // to be removed before 2.0
protected Project(RelOptCluster cluster, RelTraitSet traitSet, RelNode input,
  List<? extends RexNode> projects, RelDataType rowType, int flags) {
 this(cluster, traitSet, input, projects, rowType);
 Util.discard(flags);
}

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

@Deprecated // to be removed before 2.0
public LogicalProject(RelOptCluster cluster, RelTraitSet traitSet,
  RelNode input, List<? extends RexNode> projects, RelDataType rowType,
  int flags) {
 this(cluster, traitSet, input, projects, rowType);
 Util.discard(flags);
}

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

@Deprecated // to be removed before 2.0
public LogicalCalc(
  RelOptCluster cluster,
  RelTraitSet traitSet,
  RelNode child,
  RexProgram program,
  List<RelCollation> collationList) {
 this(cluster, traitSet, child, program);
 Util.discard(collationList);
}

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

@Deprecated // to be removed before 2.0
public Project copy(RelTraitSet traitSet, RelNode input,
  List<RexNode> projects, RelDataType rowType, int flags) {
 Util.discard(flags);
 return copy(traitSet, input, projects, rowType);
}

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

@Deprecated // to be removed before 2.0
public Calc copy(
  RelTraitSet traitSet,
  RelNode child,
  RexProgram program,
  List<RelCollation> collationList) {
 Util.discard(collationList);
 return copy(traitSet, child, program);
}

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

public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) {
 final SqlQualified fqId = scope.fullyQualify(id);
 if (expandColumnReferences) {
  // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its
  // own ideas about qualification.
  id.assignNamesFrom(fqId.identifier);
 } else {
  Util.discard(fqId);
 }
}

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

public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) {
 final SqlQualified fqId = scope.fullyQualify(id);
 if (expandColumnReferences) {
  // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its
  // own ideas about qualification.
  id.assignNamesFrom(fqId.identifier);
 } else {
  Util.discard(fqId);
 }
}

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

public SqlNode validate(SqlNode topNode) {
 SqlValidatorScope scope = new EmptyScope(this);
 scope = new CatalogScope(scope, ImmutableList.of("CATALOG"));
 final SqlNode topNode2 = validateScopedExpression(topNode, scope);
 final RelDataType type = getValidatedNodeType(topNode2);
 Util.discard(type);
 return topNode2;
}

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

/** Creates a {@link DataContext} and executes a callback. */
public <T> AssertThat doWithDataContext(Function<DataContext, T> fn)
  throws Exception {
 try (CalciteConnection connection =
      (CalciteConnection) connectionFactory.createConnection()) {
  final DataContext dataContext =
    CalciteMetaImpl.createDataContext(connection);
  T t = fn.apply(dataContext);
  Util.discard(t);
  return AssertThat.this;
 }
}

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

/** Checks that all pattern variables within a function are the same,
 * and canonizes expressions such as {@code PREV(B.price)} to
 * {@code LAST(B.price, 0)}. */
private SqlNode navigationInDefine(SqlNode node, String alpha) {
 Set<String> prefix = node.accept(new PatternValidator(false));
 Util.discard(prefix);
 node = new NavigationExpander().go(node);
 node = new NavigationReplacer(alpha).go(node);
 return node;
}

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

@Override public void onMatch(RelOptRuleCall call) {
  final Delta delta = call.rel(0);
  Util.discard(delta);
  final Filter filter = call.rel(1);
  final LogicalDelta newDelta = LogicalDelta.create(filter.getInput());
  final LogicalFilter newFilter =
    LogicalFilter.create(newDelta, filter.getCondition());
  call.transformTo(newFilter);
 }
}

相关文章