You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ajith S (JIRA)" <ji...@apache.org> on 2018/08/30 03:35:00 UTC

[jira] [Updated] (SPARK-25276) Redundant constrains when using alias

     [ https://issues.apache.org/jira/browse/SPARK-25276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ajith S updated SPARK-25276:
----------------------------
    Attachment: test.patch

> Redundant constrains when using alias
> -------------------------------------
>
>                 Key: SPARK-25276
>                 URL: https://issues.apache.org/jira/browse/SPARK-25276
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 2.1.0, 2.3.1
>            Reporter: Ajith S
>            Priority: Major
>         Attachments: test.patch
>
>
> Attaching a test to reproduce the issue. The test fails with following message
> {color:#FF0000}== FAIL: Constraints do not match ==={color}
> {color:#FF0000}Found: isnotnull(z#5),(z#5 > 10),(x#3 > 10),(z#5 <=> x#3),(b#1 <=> y#4),isnotnull(x#3){color}
> {color:#FF0000}Expected: (x#3 > 10),isnotnull(x#3),(b#1 <=> y#4),(z#5 <=> x#3){color}
> {color:#FF0000}== Result =={color}
> {color:#FF0000}Missing: N/A{color}
> {color:#FF0000}Found but not expected: isnotnull(z#5),(z#5 > 10){color}
> Here i think as z has a EqualNullSafe comparison with x, so having isnotnull(z#5),(z#5 > 10) is redundant. If a query has lot of aliases, this may cause overhead.
> So i suggest [https://github.com/apache/spark/blob/v2.3.2-rc5/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala#L254] instead of  addAll++= we must just assign =



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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