当前位置: 首页>>代码示例>>Java>>正文


Java SqlKind.OTHER属性代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlKind.OTHER属性的典型用法代码示例。如果您正苦于以下问题:Java SqlKind.OTHER属性的具体用法?Java SqlKind.OTHER怎么用?Java SqlKind.OTHER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.calcite.sql.SqlKind的用法示例。


在下文中一共展示了SqlKind.OTHER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toTreeEx

/**
 * Converts a list of {expression, operator, expression, ...} into a tree,
 * taking operator precedence and associativity into account.
 *
 * @param list        List of operands and operators. This list is modified as
 *                    expressions are reduced.
 * @param start       Position of first operand in the list. Anything to the
 *                    left of this (besides the immediately preceding operand)
 *                    is ignored. Generally use value 1.
 * @param minPrec     Minimum precedence to consider. If the method encounters
 *                    an operator of lower precedence, it doesn't reduce any
 *                    further.
 * @param stopperKind If not {@link SqlKind#OTHER}, stop reading the list if
 *                    we encounter a token of this kind.
 * @return the root node of the tree which the list condenses into
 */
public static SqlNode toTreeEx(SqlSpecialOperator.TokenSequence list,
    int start, final int minPrec, final SqlKind stopperKind) {
  final Predicate<PrecedenceClimbingParser.Token> predicate =
      new PredicateImpl<PrecedenceClimbingParser.Token>() {
        public boolean test(PrecedenceClimbingParser.Token t) {
          if (t instanceof PrecedenceClimbingParser.Op) {
            final SqlOperator op = ((ToTreeListItem) t.o).op;
            return stopperKind != SqlKind.OTHER
                && op.kind == stopperKind
                || minPrec > 0
                && op.getLeftPrec() < minPrec;
          } else {
            return false;
          }
        }
      };
  PrecedenceClimbingParser parser = list.parser(start, predicate);
  final int beforeSize = parser.all().size();
  parser.partialParse();
  final int afterSize = parser.all().size();
  final SqlNode node = convert(parser.all().get(0));
  list.replaceSublist(start, start + beforeSize - afterSize + 1, node);
  return node;
}
 
开发者ID:apache,项目名称:calcite,代码行数:40,代码来源:SqlParserUtil.java

示例2: SqlMultisetMemberOfOperator

public SqlMultisetMemberOfOperator() {
  // TODO check if precedence is correct
  super(
      "MEMBER OF",
      SqlKind.OTHER,
      30,
      true,
      ReturnTypes.BOOLEAN_NULLABLE,
      null,
      null);
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:SqlMultisetMemberOfOperator.java

示例3: SqlDatePartFunction

public SqlDatePartFunction(String name, TimeUnit timeUnit) {
  super(name,
      SqlKind.OTHER,
      ReturnTypes.BIGINT_NULLABLE,
      InferTypes.FIRST_KNOWN,
      OperandTypes.DATETIME,
      SqlFunctionCategory.TIMEDATE);
  this.timeUnit = timeUnit;
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:SqlDatePartFunction.java

示例4: SqlThrowOperator

public SqlThrowOperator() {
  super(
      "$throw",
      SqlKind.OTHER,
      2,
      true,
      ReturnTypes.BOOLEAN,
      null,
      OperandTypes.CHARACTER);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlThrowOperator.java

示例5: SqlMultisetSetOperator

public SqlMultisetSetOperator(String name, int prec, boolean all) {
  super(
      name,
      SqlKind.OTHER,
      prec,
      true,
      ReturnTypes.MULTISET_NULLABLE,
      InferTypes.FIRST_KNOWN,
      OperandTypes.MULTISET_MULTISET);
  this.all = all;
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:SqlMultisetSetOperator.java

示例6: getKind

/**
 * Returns the kind of node this is.
 *
 * @return Node kind, never null
 */
public SqlKind getKind() {
  return SqlKind.OTHER;
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:RexNode.java


注:本文中的org.apache.calcite.sql.SqlKind.OTHER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。