Java Code Examples for org.apache.calcite.sql.fun.SqlAvgAggFunction

The following examples show how to use org.apache.calcite.sql.fun.SqlAvgAggFunction. These examples are extracted from open source projects. 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 Project: Bats   Source File: DrillReduceAggregatesRule.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns whether any of the aggregates are calls to AVG, STDDEV_*, VAR_*.
 *
 * @param aggCallList List of aggregate calls
 */
private boolean containsAvgStddevVarCall(List<AggregateCall> aggCallList) {
  for (AggregateCall call : aggCallList) {
    SqlAggFunction sqlAggFunction = DrillCalciteWrapperUtility.extractSqlOperatorFromWrapper(call.getAggregation());
    if (sqlAggFunction instanceof SqlAvgAggFunction
        || sqlAggFunction instanceof SqlSumAggFunction) {
      return true;
    }
  }
  return false;
}
 
Example 2
Source Project: kylin-on-parquet-v2   Source File: OLAPAggregateRule.java    License: Apache License 2.0 5 votes vote down vote up
private boolean containsAvg(LogicalAggregate agg) {
    for (AggregateCall call : agg.getAggCallList()) {
        SqlAggFunction func = call.getAggregation();
        if (func instanceof SqlAvgAggFunction)
            return true;
    }
    return false;
}
 
Example 3
Source Project: kylin   Source File: OLAPAggregateRule.java    License: Apache License 2.0 5 votes vote down vote up
private boolean containsAvg(LogicalAggregate agg) {
    for (AggregateCall call : agg.getAggCallList()) {
        SqlAggFunction func = call.getAggregation();
        if (func instanceof SqlAvgAggFunction)
            return true;
    }
    return false;
}