本文整理汇总了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()]));
}
示例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()]));
}
示例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);
}
}
示例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()]));
}
示例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;
}
}
示例6: getMergeAggFunctionOfTopSplit
@Override public SqlAggFunction getMergeAggFunctionOfTopSplit() {
return SqlStdOperatorTable.SUM;
}