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: [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]