cloud-fan commented on code in PR #48748:
URL: https://github.com/apache/spark/pull/48748#discussion_r1849794306
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionResolution.scala:
##########
@@ -149,6 +145,10 @@ class FunctionResolution(
func.prettyName,
"WITHIN GROUP (ORDER BY ...)"
)
+ case listAgg: ListAgg
+ if u.isDistinct && !listAgg.isOrderCompatible(u.orderingWithinGroup) =>
Review Comment:
I have two questions:
1. why is this limitation? What's wrong with `listagg(DISTINCT c1) WITHIN
GROUP (ORDER BY c2)`? Because the result is non-deterministic as we will
randomly pick a value of `c2` for each distinct `c1`? Do other systems also
forbid it?
2. How to make sure the related expressions are fully resolved as we need to
do semantic comparison by calling `semanticEquals`? Ideally this is something
to be checked in `CheckAnalysis`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]