cloud-fan commented on a change in pull request #31402:
URL: https://github.com/apache/spark/pull/31402#discussion_r568728754



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -3162,6 +3162,9 @@ class Analyzer(override val catalogManager: 
CatalogManager)
       case WindowExpression(wf: FrameLessOffsetWindowFunction,
         WindowSpecDefinition(_, _, f: SpecifiedWindowFrame)) if wf.frame != f 
=>
         throw 
QueryCompilationErrors.cannotSpecifyWindowFrameError(wf.prettyName)
+      case WindowExpression(wf: AggregateWindowFunction, s: 
WindowSpecDefinition)
+        if wf.frame != UnspecifiedFrame =>
+        WindowExpression(wf, s.copy(frameSpecification = wf.frame))

Review comment:
       PG is not the golden standard Spark has to follow. To me, the PG 
behavior looks unreasonable as it silently ignores the user input. Can we 
investigate more databases? I'd expect that we should fail if a user specified 
window frame but the window function can only use its default frame.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to