Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21473#discussion_r192292014
--- 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 --
It's weird to throw exception inside a boolean function `hasXXX`.
Can we do this check in
https://github.com/apache/spark/pull/21473/files#diff-57b3d87be744b7d79a9beacf8e5e5eb2R1838
?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]