Skip to content

Commit

Permalink
Update Analyzer.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Jun 6, 2020
1 parent 282648d commit c4ff823
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1509,14 +1509,14 @@ class Analyzer(

def needResolveStructField(plan: LogicalPlan): Boolean = {
plan match {
case h @ UnresolvedHaving(havingCondition, a: Aggregate)
case UnresolvedHaving(havingCondition, a: Aggregate)
if containSameStructFields(a.groupingExpressions.flatMap(_.references),
a.aggregateExpressions.flatMap(_.references),
Some(havingCondition.references.toSeq)) => true
case a @ Aggregate(groupingExpressions, aggregateExpressions, child)
case Aggregate(groupingExpressions, aggregateExpressions, _)
if containSameStructFields(groupingExpressions.flatMap(_.references),
aggregateExpressions.flatMap(_.references)) => true
case x @ GroupingSets(selectedGroupByExprs, groupByExprs, child, aggregations)
case GroupingSets(selectedGroupByExprs, groupByExprs, _, aggregations)
if containSameStructFields(groupByExprs.flatMap(_.references),
aggregations.flatMap(_.references),
Some(selectedGroupByExprs.flatMap(_.flatMap(_.references)))) => true
Expand All @@ -1528,6 +1528,7 @@ class Analyzer(
grpExprs: Seq[Attribute],
aggExprs: Seq[Attribute],
extra: Option[Seq[Attribute]] = None): Boolean = {

def isStructField(attr: Attribute): Boolean = {
attr.isInstanceOf[UnresolvedAttribute] &&
attr.asInstanceOf[UnresolvedAttribute].nameParts.size == 2
Expand Down

0 comments on commit c4ff823

Please sign in to comment.