Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/281#discussion_r151014919 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/execute/AggregatePlan.java --- @@ -112,7 +114,26 @@ private AggregatePlan(StatementContext context, FilterableStatement statement, T public Expression getHaving() { return having; } - + + @Override + public Cost getCost() throws SQLException { + Long byteCount = getEstimatedBytesToScan(); + if (byteCount == null) { + return Cost.ZERO; + } + + int parallelLevel = 10; --- End diff -- How about passing in groupBy instead of just groupBy.isUngroupedAggregate() as I think we'd want to get more info eventually out of the groupBy (for example, if it's ordered or unordered which impacts memory usage substantially)?
---