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


Java SqlOperator.isAggregator方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:23,代码来源:SqlValidatorImpl.java

示例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());
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:SqlToRelConverter.java

示例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());
}
 
开发者ID:apache,项目名称:kylin,代码行数:12,代码来源:SqlToRelConverter.java

示例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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:49,代码来源:AggVisitor.java


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