xiedeyantu commented on code in PR #4548:
URL: https://github.com/apache/calcite/pull/4548#discussion_r2370480302
##########
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:
Do you mean I should add a any_value(x) in sql to see the execution result?
I don't quite understand the necessity of doing this. Could you tell me the
specific issue you're concerned about?
--
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]