You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by we...@apache.org on 2022/03/28 14:08:03 UTC

[spark] branch branch-3.3 updated: [SPARK-38432][SQL][FOLLOWUP] Add test case for push down filter with alias

This is an automated email from the ASF dual-hosted git repository.

wenchen pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new a5d6d05  [SPARK-38432][SQL][FOLLOWUP] Add test case for push down filter with alias
a5d6d05 is described below

commit a5d6d0570bd60c776bbe1e5e467892e25109315a
Author: Jiaan Geng <be...@163.com>
AuthorDate: Mon Mar 28 22:06:05 2022 +0800

    [SPARK-38432][SQL][FOLLOWUP] Add test case for push down filter with alias
    
    ### What changes were proposed in this pull request?
    DS V2 pushdown predicates to data source supports column with alias.
    But Spark missing the test case for push down filter with alias.
    
    ### Why are the changes needed?
    Add test case for push down filter with alias
    
    ### Does this PR introduce _any_ user-facing change?
    'No'.
    Just add a test case.
    
    ### How was this patch tested?
    New tests.
    
    Closes #35988 from beliefer/SPARK-38432_followup2.
    
    Authored-by: Jiaan Geng <be...@163.com>
    Signed-off-by: Wenchen Fan <we...@databricks.com>
    (cherry picked from commit 65608251f84a7ed8232aa288b9fdd36d0dd5189e)
    Signed-off-by: Wenchen Fan <we...@databricks.com>
---
 .../src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
index afbdc60..791600a 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
@@ -350,6 +350,13 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
       "WHEN IS_MANAGER = true THEN FALSE ELSE DEPT > 3 END], ")
     checkAnswer(df9, Seq(Row(2, "alex", 12000, 1200, false),
       Row(2, "david", 10000, 1300, true), Row(6, "jen", 12000, 1200, true)))
+
+    val df10 = spark.table("h2.test.people")
+      .select($"NAME".as("myName"), $"ID".as("myID"))
+      .filter($"myID" > 1)
+    checkFiltersRemoved(df10)
+    checkPushedInfo(df10, "PushedFilters: [ID IS NOT NULL, ID > 1], ")
+    checkAnswer(df10, Row("mary", 2))
   }
 
   test("scan with complex filter push-down") {

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