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


Java SqlStdOperatorTable.SUM属性代码示例

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


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

示例1: toSql

/**
 * Converts a call to an aggregate function to an expression.
 */
final SqlNode toSql(AggregateCall aggCall) {
    SqlOperator op = aggCall.getAggregation();
    if (op instanceof SqlSumEmptyIsZeroAggFunction) {
        op = SqlStdOperatorTable.SUM;
    }
    final List<SqlNode> operands = Expressions.list();
    for (int arg : aggCall.getArgList()) {
        operands.add(field(arg));
    }
    return op.createCall(
            aggCall.isDistinct() ? SqlSelectKeyword.DISTINCT.symbol(POS) : null,
            POS, operands.toArray(new SqlNode[operands.size()]));
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:16,代码来源:JdbcImplementor.java

示例2: toSql

/**
 * Converts a call to an aggregate function to an expression.
 */
public SqlNode toSql(AggregateCall aggCall) {
  SqlOperator op = (SqlAggFunction) aggCall.getAggregation();
  if (op instanceof SqlSumEmptyIsZeroAggFunction) {
    op = SqlStdOperatorTable.SUM;
  }
  final List<SqlNode> operands = Expressions.list();
  for (int arg : aggCall.getArgList()) {
    operands.add(field(arg));
  }
  return op.createCall(
      aggCall.isDistinct() ? SqlSelectKeyword.DISTINCT.symbol(POS) : null,
      POS, operands.toArray(new SqlNode[operands.size()]));
}
 
开发者ID:qubole,项目名称:quark,代码行数:16,代码来源:RelToSqlConverter.java

示例3: resolveAgg

private SqlAggFunction resolveAgg(String aggName) {
  if (aggName.equalsIgnoreCase("count")) {
    return SqlStdOperatorTable.COUNT;
  } else if (aggName.equalsIgnoreCase("sum")) {
    return SqlStdOperatorTable.SUM;
  } else {
    throw new RuntimeException("Unknown lattice aggregate function "
        + aggName);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:Lattice.java

示例4: toSql

/** Converts a call to an aggregate function to an expression. */
public SqlNode toSql(AggregateCall aggCall) {
  SqlOperator op = aggCall.getAggregation();
  if (op instanceof SqlSumEmptyIsZeroAggFunction) {
    op = SqlStdOperatorTable.SUM;
  }
  final List<SqlNode> operands = Expressions.list();
  for (int arg : aggCall.getArgList()) {
    operands.add(field(arg));
  }
  return op.createCall(
      aggCall.isDistinct() ? SqlSelectKeyword.DISTINCT.symbol(POS) : null,
      POS, operands.toArray(new SqlNode[operands.size()]));
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:SqlImplementor.java

示例5: getRollup

public static SqlAggFunction getRollup(SqlAggFunction aggregation) {
  if (aggregation == SqlStdOperatorTable.SUM
      || aggregation == SqlStdOperatorTable.MIN
      || aggregation == SqlStdOperatorTable.MAX
      || aggregation == SqlStdOperatorTable.SUM0) {
    return aggregation;
  } else if (aggregation == SqlStdOperatorTable.COUNT) {
    return SqlStdOperatorTable.SUM0;
  } else {
    return null;
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SubstitutionVisitor.java

示例6: getMergeAggFunctionOfTopSplit

@Override public SqlAggFunction getMergeAggFunctionOfTopSplit() {
  return SqlStdOperatorTable.SUM;
}
 
开发者ID:apache,项目名称:calcite,代码行数:3,代码来源:SqlSplittableAggFunction.java


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