Skip to content

Commit 23f106d

Browse files
committed
Extracts all other attributes.
1 parent 15b40ee commit 23f106d

File tree

1 file changed

+2
-12
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis

1 file changed

+2
-12
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -761,13 +761,6 @@ class Analyzer(
761761
}.isDefined
762762
}
763763

764-
private def hasAggregation(expr: NamedExpression): Boolean = {
765-
expr.find {
766-
case agg: AggregateExpression => true
767-
case _ => false
768-
}.isDefined
769-
}
770-
771764
/**
772765
* From a Seq of [[NamedExpression]]s, extract expressions containing window expressions and
773766
* other regular expressions that do not contain any window expression. For example, for
@@ -839,11 +832,8 @@ class Analyzer(
839832
extractedExprBuffer += withName
840833
withName.toAttribute
841834

842-
case ne: Alias if hasWindowFunction(ne) && !hasAggregation(ne) =>
843-
ne.children.map(_.transform {
844-
case e: NamedExpression => extractExpr(e)
845-
})
846-
ne
835+
// Extracts other attributes
836+
case attr: Attribute => extractExpr(attr)
847837

848838
}.asInstanceOf[NamedExpression]
849839
}

0 commit comments

Comments
 (0)