Github user aokolnychyi commented on a diff in the pull request: https://github.com/apache/spark/pull/21473#discussion_r192234621 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala --- @@ -1744,11 +1744,14 @@ class Analyzer( * it into the plan tree. */ object ExtractWindowExpressions extends Rule[LogicalPlan] { - private def hasWindowFunction(projectList: Seq[NamedExpression]): Boolean = - projectList.exists(hasWindowFunction) + private def hasWindowFunction(exprs: Seq[Expression]): Boolean = + exprs.exists(hasWindowFunction) - private def hasWindowFunction(expr: NamedExpression): Boolean = { + private def hasWindowFunction(expr: Expression): Boolean = { expr.find { + case AggregateExpression(aggFunc, _, _, _) if hasWindowFunction(aggFunc.children) => --- End diff -- I have some doubts that this is the best place for this check. StackOverflow happens in ``extract``. We can also define a separate method and call it inside ``extract``. However, that method will share the same structure as ``hasWindowFunction``.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org