Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed Dec 13, 2018
1 parent 6172f52 commit ec710d7
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -72,11 +72,13 @@ object RewritePredicateSubquery extends Rule[LogicalPlan] with PredicateHelper {
val outerRefs = outerPlan.outputSet ++ outerReferences
val duplicates = outerRefs.intersect(subplan.outputSet)
if (duplicates.nonEmpty) {
condition.foreach {
case e if e.references.intersect(duplicates).nonEmpty =>
throw new AnalysisException(s"Found conflicting attributes ${duplicates.mkString(",")} " +
s"in nodes:\n $outerPlan\n $subplan")
case _ =>
condition.foreach { e =>
val conflictingAttrs = e.references.intersect(duplicates)
if (conflictingAttrs.nonEmpty) {
throw new AnalysisException("Found conflicting attributes " +
s"${conflictingAttrs.mkString(",")} in the condition joining outer plan:\n " +
s"$outerPlan\nand subplan:\n $subplan")
}
}
val rewrites = AttributeMap(duplicates.map { dup =>
dup -> Alias(dup, dup.toString)()
Expand Down

0 comments on commit ec710d7

Please sign in to comment.