beliefer commented on code in PR #44184: URL: https://github.com/apache/spark/pull/44184#discussion_r1421391653
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala: ########## @@ -146,8 +114,86 @@ case class Mode( override def withNewInputAggBufferOffset(newInputAggBufferOffset: Int): Mode = copy(inputAggBufferOffset = newInputAggBufferOffset) - override def withNewChildrenInternal(newLeft: Expression, newRight: Expression): Expression = - copy(child = newLeft, deterministicExpr = newRight) + override def sql(isDistinct: Boolean): String = { + reverseOpt.map { + reverse => + if (reverse) { + s"$prettyName() WITHIN GROUP (ORDER BY ${child.sql} DESC)" Review Comment: I can't find the usage. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org