GitHub user viirya opened a pull request: https://github.com/apache/spark/pull/11809
[SPARK-13995][SQL] Constraints should take care of Cast ## What changes were proposed in this pull request? JIRA: https://issues.apache.org/jira/browse/SPARK-13995 We infer relative constraints from logical plan's expressions. However, we don't consider `Cast` expression now. For example: val tr = LocalRelation('a.int, 'b.long) val plan = tr.where('a.attr === 'b.attr).analyze Then, the plan's constraints will have `IsNotNull(Cast(resolveColumn(tr, "a"), LongType))`, instead of `IsNotNull(resolveColumn(tr, "a"))`. ## How was this patch tested? Test is added into `ConstraintPropagationSuite`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/viirya/spark-1 constraint-cast Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/11809.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #11809 ---- commit c2f9b058f6ad243e35518bc1758fe7ef7ac2c25f Author: Liang-Chi Hsieh <sim...@tw.ibm.com> Date: 2016-03-17T14:02:12Z init import. commit b4e60339f713590fdb7294ab735eaefbe1940501 Author: Liang-Chi Hsieh <sim...@tw.ibm.com> Date: 2016-03-18T02:41:16Z Add test. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org