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

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

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

Util.swallow介绍

[英]Records that an exception has been caught but will not be re-thrown. If the tracer is not null, logs the exception to the tracer.
[中]记录异常已被捕获但不会重新抛出。如果跟踪程序不为null,则将异常记录到跟踪程序中。

代码示例

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

private ImmutableList<RexNode> getValidPreds(RelOptCluster cluster, RelNode child,
  Set<String> predicatesToExclude, List<RexNode> rexs, RelDataType rType) {
 InputRefValidator validator = new InputRefValidator(rType.getFieldList());
 List<RexNode> valids = new ArrayList<RexNode>(rexs.size());
 for (RexNode rex : rexs) {
  try {
   rex.accept(validator);
   valids.add(rex);
  } catch (Util.FoundOne e) {
   Util.swallow(e, null);
  }
 }
 // We need to filter i) those that have been pushed already as stored in the join,
 // and ii) those that were already in the subtree rooted at child
 ImmutableList<RexNode> toPush = HiveCalciteUtil.getPredsNotPushedAlready(predicatesToExclude,
     child, valids);
 return toPush;
}

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

private ImmutableList<RexNode> getValidPreds(RelOptCluster cluster, RelNode child,
  Set<String> predicatesToExclude, List<RexNode> rexs, RelDataType rType) {
 InputRefValidator validator = new InputRefValidator(rType.getFieldList());
 List<RexNode> valids = new ArrayList<RexNode>(rexs.size());
 for (RexNode rex : rexs) {
  try {
   rex.accept(validator);
   valids.add(rex);
  } catch (Util.FoundOne e) {
   Util.swallow(e, null);
  }
 }
 // We need to filter i) those that have been pushed already as stored in the join,
 // and ii) those that were already in the subtree rooted at child
 ImmutableList<RexNode> toPush = HiveCalciteUtil.getPredsNotPushedAlready(predicatesToExclude,
     child, valids);
 return toPush;
}

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

/**
 * Calls the parent class method and masks Farrago exception thrown.
 */
protected void validateHavingClause(SqlSelect select) {
 try {
  super.validateHavingClause(select);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

/**
 * Calls the parent class method and masks Farrago exception thrown.
 */
protected void validateHavingClause(SqlSelect select) {
 try {
  super.validateHavingClause(select);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

protected void validateFrom(
  SqlNode node,
  RelDataType targetRowType,
  SqlValidatorScope scope) {
 try {
  super.validateFrom(node, targetRowType, scope);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

/**
 * Calls the parent class method and masks Farrago exception thrown.
 */
protected void validateWhereClause(SqlSelect select) {
 try {
  super.validateWhereClause(select);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

/**
 * Returns whether an expression contains an OVER clause.
 */
public static boolean containsOver(RexNode expr) {
 try {
  expr.accept(FINDER);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

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

/**
 * Returns whether an expression contains an OVER clause.
 */
public static boolean containsOver(RexNode expr) {
 try {
  expr.accept(FINDER);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

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

/**
 * Returns whether an expression list contains an OVER clause.
 */
public static boolean containsOver(List<RexNode> exprs, RexNode condition) {
 try {
  RexUtil.apply(FINDER, exprs, condition);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

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

public RexNode toCnf(RexNode rex) {
 try {
  this.currentCount = 0;
  return toCnf2(rex);
 } catch (OverflowError e) {
  Util.swallow(e, null);
  return rex;
 }
}

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

/**
 * Returns whether an expression list contains an OVER clause.
 */
public static boolean containsOver(List<RexNode> exprs, RexNode condition) {
 try {
  RexUtil.apply(FINDER, exprs, condition);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

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

/**
 * Calls the parent class method and masks Farrago exception thrown.
 */
protected void validateWhereClause(SqlSelect select) {
 try {
  super.validateWhereClause(select);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

public RexNode toCnf(RexNode rex) {
 try {
  this.currentCount = 0;
  return toCnf2(rex);
 } catch (OverflowError e) {
  Util.swallow(e, null);
  return rex;
 }
}

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

protected void validateFrom(
  SqlNode node,
  RelDataType targetRowType,
  SqlValidatorScope scope) {
 try {
  super.validateFrom(node, targetRowType, scope);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

/**
 * Registers the identifier and its scope into a map keyed by ParserPosition.
 */
public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) {
 registerId(id, scope);
 try {
  super.validateIdentifier(id, scope);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

public SqlCall findAgg(List<SqlNode> nodes) {
 try {
  for (SqlNode node : nodes) {
   node.accept(this);
  }
  return null;
 } catch (Util.FoundOne e) {
  Util.swallow(e, null);
  return (SqlCall) e.getNode();
 }
}

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

public SqlCall findAgg(List<SqlNode> nodes) {
 try {
  for (SqlNode node : nodes) {
   node.accept(this);
  }
  return null;
 } catch (Util.FoundOne e) {
  Util.swallow(e, null);
  return (SqlCall) e.getNode();
 }
}

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

/**
 * Registers the identifier and its scope into a map keyed by ParserPosition.
 */
public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) {
 registerId(id, scope);
 try {
  super.validateIdentifier(id, scope);
 } catch (CalciteException e) {
  Util.swallow(e, TRACER);
 }
}

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

/**
 * Returns whether a program contains an OVER clause.
 */
public static boolean containsOver(RexProgram program) {
 try {
  RexUtil.apply(FINDER, program.getExprList(), null);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

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

/**
 * Returns whether a program contains an OVER clause.
 */
public static boolean containsOver(RexProgram program) {
 try {
  RexUtil.apply(FINDER, program.getExprList(), null);
  return false;
 } catch (OverFound e) {
  Util.swallow(e, null);
  return true;
 }
}

相关文章