// This original column must be unique for a given set of values for the grouping/pivoting
// columns so any aggregation operation out of MIN, MAX, AVG will return the value
// itself and will not aggregate anything. The example from before,
// SELECT A, max(B) GROUP BY A PIVOT C turns into SELECT A, min(max-B) GROUP BY A PIVOT C
completionQuery.copyFrom(query);
completionQuery.setFilter(null);
QuerySelection completionSelection = new QuerySelection();
List<AbstractColumn> originalSelectedColumns =
query.getSelection().getColumns();