beliefer commented on code in PR #35041:
URL: https://github.com/apache/spark/pull/35041#discussion_r843374143
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -226,10 +226,11 @@ trait CheckAnalysis extends PredicateHelper with
LookupCatalog {
// Only allow window functions with an aggregate expression or an
offset window
// function or a Pandas window UDF.
w.windowFunction match {
- case AggregateExpression(_: PercentileCont, _, _, _, _)
+ case AggregateExpression(_: PercentileCont | _: PercentileDisc,
_, _, _, _)
if w.windowSpec.orderSpec.nonEmpty ||
w.windowSpec.frameSpecification !=
SpecifiedWindowFrame(RowFrame, UnboundedPreceding,
UnboundedFollowing) =>
- failAnalysis("Cannot specify order by or frame for
'PERCENTILE_CONT'.")
+ failAnalysis(
+ "Cannot specify order by or frame for 'PERCENTILE_CONT' or
'PERCENTILE_DISC'.")
Review Comment:
The behavior follows Oracle.
`SQL 错误 [30487] [99999]: ORA-30487: ORDER BY forbid here`
--
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]