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


Java SqlKind.OVER属性代码示例

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


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

示例1: visit

@Override public Void visit(SqlCall call) {
	// ignore window aggregates and ranking functions (associated with OVER operator)
	if (call.getOperator().getKind() == SqlKind.OVER) {
		return null;
	}
	if (call.getOperator().isAggregator()) {
		list.add(call);
		return null;
	}

	// Don't traverse into sub-queries, even if they contain aggregate
	// functions.
	if (call instanceof SqlSelect) {
		return null;
	}

	return call.getOperator().acceptCall(this, call);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:18,代码来源:SqlToRelConverter.java

示例2: visit

@Override public Void visit(SqlCall call) {
  // ignore window aggregates and ranking functions (associated with OVER operator)
  if (call.getOperator().getKind() == SqlKind.OVER) {
    return null;
  }
  if (call.getOperator().isAggregator()) {
    list.add(call);
    return null;
  }

  // Don't traverse into sub-queries, even if they contain aggregate
  // functions.
  if (call instanceof SqlSelect) {
    return null;
  }

  return call.getOperator().acceptCall(this, call);
}
 
开发者ID:apache,项目名称:kylin,代码行数:18,代码来源:SqlToRelConverter.java

示例3: visit

@Override public Void visit(SqlCall call) {
  // ignore window aggregates and ranking functions (associated with OVER operator)
  if (call.getOperator().getKind() == SqlKind.OVER) {
    return null;
  }

  if (call.getOperator().getKind() == SqlKind.FILTER) {
    // the WHERE in a FILTER must be tracked too so we can call replaceSubQueries on it.
    // see https://issues.apache.org/jira/browse/CALCITE-1910
    final SqlNode aggCall = call.getOperandList().get(0);
    final SqlNode whereCall = call.getOperandList().get(1);
    list.add(aggCall);
    filterList.add(whereCall);
    return null;
  }

  if (call.getOperator().isAggregator()) {
    list.add(call);
    return null;
  }

  // Don't traverse into sub-queries, even if they contain aggregate
  // functions.
  if (call instanceof SqlSelect) {
    return null;
  }

  return call.getOperator().acceptCall(this, call);
}
 
开发者ID:apache,项目名称:calcite,代码行数:29,代码来源:SqlToRelConverter.java

示例4: getWindowInOver

private SqlWindow getWindowInOver(SqlNode over) {
  if (over.getKind() == SqlKind.OVER) {
    SqlNode window = ((SqlCall) over).getOperandList().get(1);
    if (window instanceof SqlWindow) {
      return (SqlWindow) window;
    }
    // SqlIdentifier, gets validated elsewhere
    return null;
  }
  return null;
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:SqlValidatorImpl.java

示例5: visit

public Void visit(SqlCall call) {
  final SqlOperator operator = call.getOperator();
  // If nested aggregates disallowed or found an aggregate at invalid level
  if (operator.isAggregator()
      && !(operator instanceof SqlAbstractGroupFunction)
      && !operator.requiresOver()) {
    if (delegate != null) {
      return operator.acceptCall(delegate, call);
    }
    if (aggregate) {
      return found(call);
    }
  }
  if (group && operator.isGroup()) {
    return found(call);
  }
  // User-defined function may not be resolved yet.
  if (operator instanceof SqlFunction) {
    final SqlFunction sqlFunction = (SqlFunction) operator;
    if (sqlFunction.getFunctionType().isUserDefinedNotSpecificFunction()) {
      final List<SqlOperator> list = Lists.newArrayList();
      opTab.lookupOperatorOverloads(sqlFunction.getSqlIdentifier(),
          sqlFunction.getFunctionType(), SqlSyntax.FUNCTION, list);
      for (SqlOperator operator2 : list) {
        if (operator2.isAggregator() && !operator2.requiresOver()) {
          // If nested aggregates disallowed or found aggregate at invalid
          // level
          if (aggregate) {
            found(call);
          }
        }
      }
    }
  }
  if (call.isA(SqlKind.QUERY)) {
    // don't traverse into queries
    return null;
  }
  if (call.getKind() == SqlKind.OVER) {
    if (over) {
      return found(call);
    } else {
      // an aggregate function over a window is not an aggregate!
      return null;
    }
  }
  return super.visit(call);
}
 
开发者ID:apache,项目名称:calcite,代码行数:48,代码来源:AggVisitor.java

示例6: visit

@Override public Void visit(SqlCall call) {
  if (call.getKind() == SqlKind.OVER) {
    throw FoundOne.NULL;
  }
  return super.visit(call);
}
 
开发者ID:apache,项目名称:calcite,代码行数:6,代码来源:Util.java


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