[GitHub] [spark] beliefer commented on a change in pull request #30021: [SPARK-33125][SQL] Improve the error when Lead and Lag are not allowed to specify window frame

2020-10-13 Thread GitBox


beliefer commented on a change in pull request #30021:
URL: https://github.com/apache/spark/pull/30021#discussion_r503726517



##
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##
@@ -2974,9 +2974,9 @@ class Analyzer(
*/
   object ResolveWindowFrame extends Rule[LogicalPlan] {
 def apply(plan: LogicalPlan): LogicalPlan = plan resolveExpressions {
-  case WindowExpression(wf: WindowFunction, WindowSpecDefinition(_, _, f: 
SpecifiedWindowFrame))
-  if wf.frame != UnspecifiedFrame && wf.frame != f =>
-failAnalysis(s"Window Frame $f must match the required frame 
${wf.frame}")
+  case WindowExpression(owf: OffsetWindowFunction,
+WindowSpecDefinition(_, _, _: SpecifiedWindowFrame)) =>

Review comment:
   I got it.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] beliefer commented on a change in pull request #30021: [SPARK-33125][SQL] Improve the error when Lead and Lag are not allowed to specify window frame

2020-10-12 Thread GitBox


beliefer commented on a change in pull request #30021:
URL: https://github.com/apache/spark/pull/30021#discussion_r503643546



##
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##
@@ -2974,9 +2974,9 @@ class Analyzer(
*/
   object ResolveWindowFrame extends Rule[LogicalPlan] {
 def apply(plan: LogicalPlan): LogicalPlan = plan resolveExpressions {
-  case WindowExpression(wf: WindowFunction, WindowSpecDefinition(_, _, f: 
SpecifiedWindowFrame))

Review comment:
   OK





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org