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 2021/08/03 23:39:54 UTC
[GitHub] [spark] c21 commented on a change in pull request #33626: [SPARK-36404][SQL] Support ORC nested column vectorized reader for data source v2
c21 commented on a change in pull request #33626:
URL: https://github.com/apache/spark/pull/33626#discussion_r682170589
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala
##########
@@ -713,6 +715,33 @@ abstract class OrcQuerySuite extends OrcQueryTest with SharedSparkSession {
}
}
}
+
+ test("SPARK-34862: Support ORC vectorized reader for nested column") {
+ withTempPath { dir =>
+ val path = dir.getCanonicalPath
+ val df = spark.range(10).map { x =>
+ val stringColumn = s"$x" * 10
+ val structColumn = (x, s"$x" * 100)
+ val arrayColumn = (0 until 5).map(i => (x + i, s"$x" * 5))
+ val mapColumn = Map(
+ s"$x" -> (x * 0.1, (x, s"$x" * 100)),
+ (s"$x" * 2) -> (x * 0.2, (x, s"$x" * 200)),
+ (s"$x" * 3) -> (x * 0.3, (x, s"$x" * 300)))
+ (x, stringColumn, structColumn, arrayColumn, mapColumn)
+ }.toDF("int_col", "string_col", "struct_col", "array_col", "map_col")
+ df.write.format("orc").save(path)
+
+ withSQLConf(SQLConf.ORC_VECTORIZED_READER_NESTED_COLUMN_ENABLED.key -> "true") {
+ val readDf = spark.read.orc(path)
+ val vectorizationEnabled = readDf.queryExecution.executedPlan.find {
+ case scan @ (_: FileSourceScanExec | _: BatchScanExec) => scan.supportsColumnar
Review comment:
Added `BatchScanExec` here for DS v2 compared to the original test in `OrcSourceSuite.scala`. Moved the query as we can test DS v1 and v2 here via `OrcV1QuerySuite` and `OrcV2QuerySuite` defined below.
--
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: reviews-unsubscribe@spark.apache.org
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