Java Code Examples for org.apache.calcite.sql.fun.SqlStdOperatorTable#MAX

The following examples show how to use org.apache.calcite.sql.fun.SqlStdOperatorTable#MAX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractMaterializedViewRule.java    From Bats with Apache License 2.0 5 votes vote down vote up
/**
 * Get rollup aggregation function.
 */
protected SqlAggFunction getRollup(SqlAggFunction aggregation) {
    if (aggregation == SqlStdOperatorTable.SUM || aggregation == SqlStdOperatorTable.MIN
            || aggregation == SqlStdOperatorTable.MAX || aggregation == SqlStdOperatorTable.SUM0
            || aggregation == SqlStdOperatorTable.ANY_VALUE) {
        return aggregation;
    } else if (aggregation == SqlStdOperatorTable.COUNT) {
        return SqlStdOperatorTable.SUM0;
    } else {
        return null;
    }
}
 
Example 2
Source File: SubstitutionVisitor.java    From Bats with Apache License 2.0 5 votes vote down vote up
public static SqlAggFunction getRollup(SqlAggFunction aggregation) {
    if (aggregation == SqlStdOperatorTable.SUM || aggregation == SqlStdOperatorTable.MIN
            || aggregation == SqlStdOperatorTable.MAX || aggregation == SqlStdOperatorTable.SUM0
            || aggregation == SqlStdOperatorTable.ANY_VALUE) {
        return aggregation;
    } else if (aggregation == SqlStdOperatorTable.COUNT) {
        return SqlStdOperatorTable.SUM0;
    } else {
        return null;
    }
}
 
Example 3
Source File: MaterializedViewAggregateRule.java    From calcite with Apache License 2.0 5 votes vote down vote up
/**
 * Get rollup aggregation function.
 */
protected SqlAggFunction getRollup(SqlAggFunction aggregation) {
  if (aggregation == SqlStdOperatorTable.SUM
      || aggregation == SqlStdOperatorTable.MIN
      || aggregation == SqlStdOperatorTable.MAX
      || aggregation == SqlStdOperatorTable.SUM0
      || aggregation == SqlStdOperatorTable.ANY_VALUE) {
    return aggregation;
  } else if (aggregation == SqlStdOperatorTable.COUNT) {
    return SqlStdOperatorTable.SUM0;
  } else {
    return null;
  }
}
 
Example 4
Source File: SubstitutionVisitor.java    From calcite with Apache License 2.0 5 votes vote down vote up
public static SqlAggFunction getRollup(SqlAggFunction aggregation) {
  if (aggregation == SqlStdOperatorTable.SUM
      || aggregation == SqlStdOperatorTable.MIN
      || aggregation == SqlStdOperatorTable.MAX
      || aggregation == SqlStdOperatorTable.SUM0
      || aggregation == SqlStdOperatorTable.ANY_VALUE) {
    return aggregation;
  } else if (aggregation == SqlStdOperatorTable.COUNT) {
    return SqlStdOperatorTable.SUM0;
  } else {
    return null;
  }
}