code: private static boolean isDistinct(AggregationNode node)
      {
          return node.getAggregations().isEmpty() &&
                  node.getOutputSymbols().size() == node.getGroupingKeys().size() &&
                  node.getOutputSymbols().containsAll(node.getGroupingKeys());
      }
docs: Whether this node corresponds to a DISTINCT operation in SQL