presto-main/src/main/java/io/prestosql/sql/analyzer/AggregationAnalyzer.java/Visitor/isGroupingKey
class Visitor:        private boolean isGroupingKey(Expression node)
        {
            FieldId fieldId = columnReferences.get(NodeRef.of(node));
            requireNonNull(fieldId, () -> "No FieldId for " + node);

            if (orderByScope.isPresent() && isFieldFromScope(fieldId, orderByScope.get())) {
                return true;
            }

            return groupingFields.contains(fieldId);
        }