dongjoon-hyun commented on a change in pull request #29565:
URL: https://github.com/apache/spark/pull/29565#discussion_r479704560



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -3582,6 +3582,163 @@ class SQLQuerySuite extends QueryTest with 
SharedSparkSession with AdaptiveSpark
     checkAnswer(sql("SELECT 0 FROM ( SELECT * FROM B JOIN C USING (id)) " +
       "JOIN ( SELECT * FROM B JOIN C USING (id)) USING (id)"), Row(0))
   }
+
+  test("test casts pushdown on orc/parquet for integral types") {
+    def checkPushedFilters(
+      format: String,
+      df: DataFrame,
+      filters: Array[sources.Filter],
+      noScan: Boolean = false): Unit = {
+      val scanExec = df.queryExecution.sparkPlan
+        .find(_.isInstanceOf[BatchScanExec])
+      if (noScan) {
+        assert(scanExec.isEmpty)
+        return
+      }
+      val scan = scanExec.get.asInstanceOf[BatchScanExec].scan
+      format match {
+        case "orc" =>
+          assert(scan.isInstanceOf[OrcScan])
+          assert(scan.asInstanceOf[OrcScan].pushedFilters === filters)
+        case "parquet" =>
+          assert(scan.isInstanceOf[ParquetScan])
+          assert(scan.asInstanceOf[ParquetScan].pushedFilters === filters)
+        case _ =>
+          fail(s"unknown format $format")
+      }
+    }
+
+    Seq("orc", "parquet").foreach { format =>
+      withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "") {

Review comment:
       We recommend not to use irrelevant SQLConfs in the test case if the PR 
is neutral. If this is the test case limitation at 3601 ~ 3604, we had better 
change it to test with the default configuration.




----------------------------------------------------------------
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.

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