You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gengliang Wang (JIRA)" <ji...@apache.org> on 2017/09/27 08:01:00 UTC

[jira] [Created] (SPARK-22141) Propagate empty relation before checking Cartesian products

Gengliang Wang created SPARK-22141:
--------------------------------------

             Summary: Propagate empty relation before checking Cartesian products
                 Key: SPARK-22141
                 URL: https://issues.apache.org/jira/browse/SPARK-22141
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.2.0
            Reporter: Gengliang Wang
            Priority: Critical


When inferring constraints from children, Join's condition can be simply as None.
For example,
    val testRelation = LocalRelation('a.int)
    val x = testRelation.as("x")
    val y = testRelation.where($"a" === 2 && !($"a" === 2)).as("y")
    x.join(y).where($"x.a" === $"y.a")

The plan will become

Join Inner
:- LocalRelation <empty>, [a#23]
+- LocalRelation <empty>, [a#224]

And the Cartesian products check will throw exception.
Propagate empty relation before checking Cartesian products, and the issue is resolved.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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