You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wan Kun (Jira)" <ji...@apache.org> on 2023/02/06 14:40:00 UTC
[jira] [Created] (SPARK-42360) Transform LeftOuter join with IsNull filter on right side to Anti join
Wan Kun created SPARK-42360:
-------------------------------
Summary: Transform LeftOuter join with IsNull filter on right side to Anti join
Key: SPARK-42360
URL: https://issues.apache.org/jira/browse/SPARK-42360
Project: Spark
Issue Type: Improvement
Components: SQL
Affects Versions: 3.3.1
Reporter: Wan Kun
Optimize left outer join to anti join if exists IsNull filter on the right side.
For example, query
{code:sql}
SELECT t1.*
FROM t1 LEFT JOIN t2
ON t1.id = t2.id
WHERE t2.id is null and t1.id = 1 and Rand() < 0.5
{code}
can be optimized to
{code:sql}
SELECT t1.*
FROM t1 LEFT ANTI JOIN t2
ON t1.id = t2.id
WHERE t1.id = 1 and Rand() < 0.5
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org