spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ulysses you (Jira)" <>
Subject [jira] [Created] (SPARK-30353) Use constraints in SimplifyBinaryComparison optimization
Date Wed, 25 Dec 2019 13:40:00 GMT
ulysses you created SPARK-30353:

             Summary: Use constraints in SimplifyBinaryComparison optimization
                 Key: SPARK-30353
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: ulysses you

Now Spark can propagate constraint during sql optimization when `spark.sql.constraintPropagation.enabled`
is true, then `where c = 1` will convert to `where c = 1 and c is not null`. We also can use
constraint in `SimplifyBinaryComparison`.
`SimplifyBinaryComparison` will simplify expression which is not nullable and semanticEquals.
Besides we also can simplify if one expression is infered `IsNotNull`.

For e.g.
create table test (c1 string);
explain extended select c1 from test where c1 = c1 limit 10;

-- before
GlobalLimit 10
+- LocalLimit 10
   +- Filter (isnotnull(c1#20) AND (c1#20 = c1#20))
      +- Relation[c1#20]

-- after
GlobalLimit 10
+- LocalLimit 10
    +- Relation[c1#20]

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message