@Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { assert isRolledUp(column); // Our rolled up columns are only allowed in COUNT(DISTINCT ...) aggregate functions. // We only allow this when approximate results are acceptable. return ((config != null && config.approximateDistinctCount() && isCountDistinct(call)) || call.getOperator() == SqlStdOperatorTable.APPROX_COUNT_DISTINCT) && call.getOperandList().size() == 1 // for COUNT(a_1, a_2, ... a_n). n should be 1 && isValidParentKind(parent); }
@Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { assert isRolledUp(column); // Our rolled up columns are only allowed in COUNT(DISTINCT ...) aggregate functions. // We only allow this when approximate results are acceptable. return ((config != null && config.approximateDistinctCount() && isCountDistinct(call)) || call.getOperator() == SqlStdOperatorTable.APPROX_COUNT_DISTINCT) && call.getOperandList().size() == 1 // for COUNT(a_1, a_2, ... a_n). n should be 1 && isValidParentKind(parent); }
case COUNT: if (aggCall.isDistinct()) { if (aggCall.isApproximate() || config.approximateDistinctCount()) { if (complexMetric == null) { aggregation = new JsonCardinalityAggregation("cardinality", name, list);
&& (aggregateCall.isApproximate() || config.approximateDistinctCount())) { continue;
case COUNT: if (aggCall.isDistinct()) { if (aggCall.isApproximate() || config.approximateDistinctCount()) { if (complexMetric == null) { aggregation = new JsonCardinalityAggregation("cardinality", name,