cloud-fan commented on a change in pull request #31835:
URL: https://github.com/apache/spark/pull/31835#discussion_r594155658
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceNullWithFalseInPredicateSuite.scala
##########
@@ -456,15 +456,26 @@ class ReplaceNullWithFalseInPredicateSuite extends
PlanTest {
private def testMerge(originalCond: Expression, expectedCond: Expression):
Unit = {
val func = (rel: LogicalPlan, expr: Expression) => {
+ val target = rel.as("target")
+ val source = rel.as("source")
val assignments = Seq(
- Assignment('i, 'i),
- Assignment('b, 'b),
- Assignment('a, 'a),
- Assignment('m, 'm)
+ Assignment(UnresolvedAttribute("i"), UnresolvedAttribute("source.i")),
+ Assignment(UnresolvedAttribute("b"), UnresolvedAttribute("source.b")),
+ Assignment(UnresolvedAttribute("a"), UnresolvedAttribute("source.a")),
+ Assignment(UnresolvedAttribute("m"), UnresolvedAttribute("source.m"))
)
- val matchedActions = UpdateAction(Some(expr), assignments) ::
DeleteAction(Some(expr)) :: Nil
- val notMatchedActions = InsertAction(Some(expr), assignments) :: Nil
- MergeIntoTable(rel, rel, mergeCondition = expr, matchedActions,
notMatchedActions)
+ val matchedCond = expr.transform {
Review comment:
Looking at the test, we don't really care about how the column is
resolved, we just need to make sure the condition is optimized. I think we
don't need to distinguish between `matchedCond` and `notMatchedCond`, just
blindly add the "source" prefix so that it can resolve.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]