mihaibudiu commented on code in PR #4548:
URL: https://github.com/apache/calcite/pull/4548#discussion_r2370482844


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -526,6 +534,34 @@ private boolean expandSelectItem(final SqlNode selectItem, 
SqlSelect select,
     return false;
   }
 
+  /**
+   * Returns true if the node is a non-aggregated, non-grouped column in 
SELECT.
+   */
+  private boolean isNonAggregatedNonGroupedColumn(SqlNode node, SqlSelect 
select) {
+    if (aggFinder.findAgg(node) != null) {
+      return false;
+    }
+
+    if (node instanceof SqlIdentifier) {
+      SqlNodeList groupList = select.getGroup();
+      if (groupList == null) {
+        return true;
+      }
+      return groupList.getList().stream()
+          .noneMatch(groupItem -> groupItem != null
+              && node.equalsDeep(groupItem, Litmus.IGNORE));
+    }
+
+    if (node instanceof SqlCall) {

Review Comment:
   read the next question



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to