本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例6: visit
@Override public Void visit(SqlCall call) {
if (call.getKind() == SqlKind.OVER) {
throw FoundOne.NULL;
}
return super.visit(call);
}