本文整理汇总了Java中org.apache.calcite.sql.SqlOperator.isAggregator方法的典型用法代码示例。如果您正苦于以下问题:Java SqlOperator.isAggregator方法的具体用法?Java SqlOperator.isAggregator怎么用?Java SqlOperator.isAggregator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.sql.SqlOperator
的用法示例。
在下文中一共展示了SqlOperator.isAggregator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateExpr
import org.apache.calcite.sql.SqlOperator; //导入方法依赖的package包/类
/**
* Validates an expression.
*
* @param expr Expression
* @param scope Scope in which expression occurs
*/
private void validateExpr(SqlNode expr, SqlValidatorScope scope) {
if (expr instanceof SqlCall) {
final SqlOperator op = ((SqlCall) expr).getOperator();
if (op.isAggregator() && op.requiresOver()) {
throw newValidationError(expr,
RESOURCE.absentOverClause());
}
}
// Call on the expression to validate itself.
expr.validateExpr(this, scope);
// Perform any validation specific to the scope. For example, an
// aggregating scope requires that expressions are valid aggregations.
scope.validateExpr(expr);
}
示例2: visit
import org.apache.calcite.sql.SqlOperator; //导入方法依赖的package包/类
public RexNode visit(SqlCall call) {
if (agg != null) {
final SqlOperator op = call.getOperator();
if (window == null
&& (op.isAggregator() || op.getKind() == SqlKind.FILTER)) {
return agg.lookupAggregates(call);
}
}
return exprConverter.convertCall(this,
new SqlCallBinding(validator, scope, call).permutedCall());
}
示例3: visit
import org.apache.calcite.sql.SqlOperator; //导入方法依赖的package包/类
public RexNode visit(SqlCall call) {
if (agg != null) {
final SqlOperator op = call.getOperator();
if (window == null
&& (op.isAggregator() || op.getKind() == SqlKind.FILTER)) {
return agg.lookupAggregates(call);
}
}
return exprConverter.convertCall(this,
new SqlCallBinding(validator, scope, call).permutedCall());
}
示例4: visit
import org.apache.calcite.sql.SqlOperator; //导入方法依赖的package包/类
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);
}