You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/12 15:10:20 UTC

[GitHub] [spark] peter-toth commented on issue #27518: [WIP][SPARK-30768][SQL] Constraints should be inferred from inequality attributes

peter-toth commented on issue #27518: [WIP][SPARK-30768][SQL] Constraints should be inferred from inequality attributes
URL: https://github.com/apache/spark/pull/27518#issuecomment-585251432
 
 
   @wangyum, I'm a but confused now. As far as I see based on your changes, in this PR you substitute `attribute = constant` form of constraints into other constraints to infer new constraints.
   So this PR will help with your example query as from `select t1.* from SPARK_30768_1 t1 join SPARK_30768_2 t2 on (t1.c1 > t2.c1) where t1.c1 = 3` the new constraint `3 > t2.c1` is inferred.
   It will also help with those cases I mentioned:
   `select t1.* from SPARK_30768_1 t1 join SPARK_30768_2 t2 on abs(t1.c1) = t2.c1 where t1.c1 = 3` as `abs(3) = t2.c1` will be inferred.
   It will also help here: https://github.com/apache/spark/pull/27252#discussion_r378184866 as after both this PR **and** https://github.com/apache/spark/pull/27252 are merged. It will solve the issue in the comment of @cloud-fan:
   > If we have cast(a, dt) = b and a = 1, seems we can also infer cast(1, dt) = b
   
   But, I don't see how it will help with the example query here: https://github.com/apache/spark/pull/27518#issuecomment-585189218
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org