wangyum commented on issue #27518: [WIP][SPARK-30768][SQL] Constraints should 
be inferred from inequality attributes
URL: https://github.com/apache/spark/pull/27518#issuecomment-585666369
 
 
   @peter-toth Please go ahead.  I reverted the first commit because this test 
will fail:
   ```scala
   test("Constraints shouldn't be inferred from cast equality constraint(filter 
lower data type)") {
     val testRelation1 = LocalRelation('a.int)
     val testRelation2 = LocalRelation('b.long)
     val originalLeft = testRelation1.where('a === 1).subquery('left)
     val originalRight = testRelation2.subquery('right)
   
     val left = testRelation1.where(IsNotNull('a) && 'a === 1).subquery('left)
     val right = testRelation2.where(IsNotNull('b)).subquery('right)
   
     Seq(Some("left.a".attr.cast(LongType) === "right.b".attr),
       Some("right.b".attr === "left.a".attr.cast(LongType))).foreach { 
condition =>
       testConstraintsAfterJoin(originalLeft, originalRight, left, right, 
Inner, condition)
     }
   }
   ```
   ```
   == FAIL: Plans do not match ===
    'Join Inner, (b#0L = cast(a#0 as bigint))                                   
               'Join Inner, (b#0L = cast(a#0 as bigint))
   !:- Filter (((1 = a#0) AND isnotnull(a#0)) AND (cast(a#0 as bigint) = cast(1 
as bigint)))   :- Filter ((1 = a#0) AND isnotnull(a#0))
    :  +- LocalRelation <empty>, [a#0]                                          
               :  +- LocalRelation <empty>, [a#0]
   !+- Filter (isnotnull(b#0L) AND (b#0L = cast(1 as bigint)))                  
               +- Filter isnotnull(b#0L)
       +- LocalRelation <empty>, [b#0L]                                         
                  +- LocalRelation <empty>, [b#0L]
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to