cloud-fan commented on code in PR #43910:
URL: https://github.com/apache/spark/pull/43910#discussion_r1403370382
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -2367,6 +2367,21 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
case agg: AggregateFunction =>
// Note: PythonUDAF does not support these advanced clauses.
if (agg.isInstanceOf[PythonUDAF])
checkUnsupportedAggregateClause(agg, u)
+ val newAgg = agg match {
+ case factory: InverseDistributionFactory if u.sortOrder.isDefined
=>
+ if (u.isDistinct) {
+ throw
QueryCompilationErrors.distinctInverseDistributionFunctionUnsupportedError(
+ factory.prettyName)
+ }
+ factory.createInverseDistributionFunction(u.sortOrder.get)
+ case factory: InverseDistributionFactory =>
+ throw
QueryCompilationErrors.inverseDistributionFunctionMissingWithinGroupError(
+ factory.prettyName)
+ case other if u.sortOrder.isDefined =>
+ throw
QueryCompilationErrors.unsupportedInverseDistributionFunctionError(
Review Comment:
It only covers unsupported agg func. We should cover all cases in
`validateFunction`
--
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]