Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ class Analyzer(

def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
case p if !p.resolved => p // Skip unresolved nodes.
case ab: AnalysisBarrier => apply(ab.child)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to lose the AnalysisBarrier here?

Copy link
Member

@gatorsmile gatorsmile Aug 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnalysisBarrier is a leaf node. We still need to apply this rule. A better fix is to fix the rule. However, for backporting the fix, we prefer the low-risk fix.

case p: LogicalPlan if p.resolved =>
val childrenOutput = p.children.flatMap(c => c.output).groupBy(_.exprId).flatMap {
case (exprId, attributes) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2300,4 +2300,10 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
checkAnswer(aggPlusFilter1, aggPlusFilter2.collect())
}
}

test("SPARK-25051: fix nullabilities of outer join attributes doesn't stop on AnalysisBarrier") {
val df1 = spark.range(4).selectExpr("id", "cast(id as string) as name")
val df2 = spark.range(3).selectExpr("id")
assert(df1.join(df2, Seq("id"), "left_outer").where(df2("id").isNull).collect().length == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just general suggestion. We should compare the results

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, will follow it in next PRs.

}
}