You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/05/01 03:55:10 UTC

[GitHub] [spark] beliefer commented on a change in pull request #28425: [SPARK-31480][SQL] Improve the EXPLAIN FORMATTED's output for DSV2's Scan Node

beliefer commented on a change in pull request #28425:
URL: https://github.com/apache/spark/pull/28425#discussion_r418405736



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
##########
@@ -343,6 +343,74 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite
       assert(getNormalizedExplain(df1, FormattedMode) === getNormalizedExplain(df2, FormattedMode))
     }
   }
+
+  test("Explain formatted output for scan operator for datasource V2") {
+    withTempDir { dir =>
+      Seq("parquet", "orc", "csv", "json").foreach { format =>
+        val basePath = dir.getCanonicalPath + "/" + format
+        val expected_plan_fragment =
+          s"""
+             |\\(1\\) BatchScan
+             |Output \\[2\\]: \\[value#x, id#x\\]
+             |DataFilters: \\[isnotnull\\(value#x\\), \\(value#x > 2\\)\\]
+             |Format: $format
+             |Location: InMemoryFileIndex\\[.*\\]
+             |PartitionFilters: \\[isnotnull\\(id#x\\), \\(id#x > 1\\)\\]
+             |PushedFilers: \\[.*\\(id\\), .*\\(value\\), .*\\(id,1\\), .*\\(value,2\\)\\]
+             |ReadSchema: struct\\<value:int\\>
+             |""".stripMargin.trim
+

Review comment:
       Seq(("parquet", "\\[.*\\(id\\), .*\\(value\\), .*\\(id,1\\), .*\\(value,2\\)\\]"),
           ("orc", "\\[.*\\(id\\), .*\\(value\\), .*\\(id,1\\), .*\\(value,2\\)\\]"),
           ("csv", "\\[IsNotNull\\(value\\), GreaterThan\\(value,2\\)\\]"),
           ("json", "")).foreach { (format, pushedFilters) =>
          val expected_plan_fragment =
              s"""
                 |\\(1\\) BatchScan
                 |Output \\[2\\]: \\[value#x, id#x\\]
                 |DataFilters: \\[isnotnull\\(value#x\\), \\(value#x > 2\\)\\]
                 |Format: $format
                 |Location: InMemoryFileIndex\\[.*\\]
                 |PartitionFilters: \\[isnotnull\\(id#x\\), \\(id#x > 1\\)\\]
                 |PushedFilers: \\[.*\\(id\\), .*\\(value\\), .*\\(id,1\\), .*\\(value,2\\)\\]
                 ${if (pushedFilters.nonEmpty) "|PushedFilers..."}
                 |ReadSchema: struct\\<value:int\\>
                 |""".stripMargin.trim




----------------------------------------------------------------
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:
users@infra.apache.org



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