srielau commented on code in PR #59315:
URL: https://github.com/apache/spark/pull/59315#discussion_r4238596249


##########
sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala:
##########
@@ -2877,6 +2896,28 @@ class BasicCharVarcharTestSuite extends 
SharedSparkSession {
     }
   }
 
+  test("SPARK-60102: CSV CHAR filters are not pushed down") {
+    withSQLConf(SQLConf.CHAR_VARCHAR_STANDARD_SEMANTICS.key -> "true") {
+      withTempPath { path =>
+        Seq("ab,1", 
"xy,2").toDS().repartition(1).write.text(path.getCanonicalPath)
+        val df = spark.read.schema("c CHAR(4), i 
INT").csv(path.getCanonicalPath)
+        checkAnswer(df.selectExpr("concat('<', c, '>')", "i"),
+          Seq(Row("<ab  >", 1), Row("<xy  >", 2)))
+        df.createOrReplaceTempView("csv_char")

Review Comment:
   Thanks, good catch. Wrapped the block in `withTempView("csv_char")` so the 
shared session drops the view on exit (`f4bfedf`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to