Wan Kun created SPARK-42551:
-------------------------------

             Summary: Support subexpression elimination in FilterExec
                 Key: SPARK-42551
                 URL: https://issues.apache.org/jira/browse/SPARK-42551
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.3.2
            Reporter: Wan Kun


Just like SPARK-33092, We can support subexpression elimination in FilterExec 
in Whole-stage codegen.
For example: 
{code:java}
SELECT * FROM (
  SELECT v, v * v + 1 v1 from values(1) as t2(v)
) t
where v > 0 and v1 > 5 and v1 < 10

Codegen plan
{code:java}
*(1) Project [v#1, ((v#1 * v#1) + 1) AS v1#0]
+- *(1) Filter (((v#1 > 0) AND (((v#1 * v#1) + 1) > 5)) AND (((v#1 * v#1) + 1) 
< 10))
   +- *(1) LocalTableScan [v#1]

The subexpression will be execute twice times.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to