diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScan.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScan.scala index 7e6ea41cf0..cf16a174d9 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScan.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScan.scala @@ -87,4 +87,8 @@ case class ParquetScan( } override def hashCode(): Int = getClass.hashCode() + + override def description(): String = { + super.description() + ", PushedFilters: " + pushedFilters.mkString("[", ", ", "]") + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala index f1a3092a19..073aed8206 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala @@ -150,15 +150,21 @@ class DataSourceV2ScanExecRedactionSuite extends DataSourceScanRedactionTest { } test("FileScan description") { - withTempPath { path => - val dir = path.getCanonicalPath - spark.range(0, 10).write.orc(dir) - val df = spark.read.orc(dir) + Seq("json", "orc", "parquet").foreach { format => + withTempPath { path => + val dir = path.getCanonicalPath + spark.range(0, 10).write.format(format).save(dir) + val df = spark.read.format(format).load(dir) - assert(isIncluded(df.queryExecution, "ReadSchema")) - assert(isIncluded(df.queryExecution, "BatchScan")) - assert(isIncluded(df.queryExecution, "PushedFilters")) - assert(isIncluded(df.queryExecution, "Location")) + withClue(s"Source '$format':") { + assert(isIncluded(df.queryExecution, "ReadSchema")) + assert(isIncluded(df.queryExecution, "BatchScan")) + if (Seq("orc", "parquet").contains(format)) { + assert(isIncluded(df.queryExecution, "PushedFilters")) + } + assert(isIncluded(df.queryExecution, "Location")) + } + } } } }