Skip to content

Commit 8e5501d

Browse files
belieferchenzhx
authored andcommitted
[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 apache#35988 from beliefer/SPARK-38432_followup2. Authored-by: Jiaan Geng <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
1 parent 7946a7d commit 8e5501d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala

+7
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,13 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
350350
"WHEN IS_MANAGER = true THEN FALSE ELSE DEPT > 3 END], ")
351351
checkAnswer(df9, Seq(Row(2, "alex", 12000, 1200, false),
352352
Row(2, "david", 10000, 1300, true), Row(6, "jen", 12000, 1200, true)))
353+
354+
val df10 = spark.table("h2.test.people")
355+
.select($"NAME".as("myName"), $"ID".as("myID"))
356+
.filter($"myID" > 1)
357+
checkFiltersRemoved(df10)
358+
checkPushedInfo(df10, "PushedFilters: [ID IS NOT NULL, ID > 1], ")
359+
checkAnswer(df10, Row("mary", 2))
353360
}
354361

355362
test("scan with filter push-down with ansi mode") {

0 commit comments

Comments
 (0)