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 2022/01/04 03:19:11 UTC
[GitHub] [spark] yym1995 commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777804429
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala
##########
@@ -713,6 +715,27 @@ abstract class OrcQuerySuite extends OrcQueryTest with SharedSparkSession {
}
}
}
+
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
+ "cause ArrayIndexOutOfBoundsException") {
+ withTempPath { dir =>
+ val path = dir.getCanonicalPath
+ val df = spark.range(100).map { _ =>
+ val arrayColumn = (0 until 50).map(_ => (0 until 1000).map(k => k.toString))
+ arrayColumn
+ }.toDF("record").repartition(1)
+ 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
+ case _ => false
+ }.isDefined
Review comment:
Because when testing with OrcV2QuerySuite, method supportColumnarReads in
https://github.com/apache/spark/blob/branch-3.2/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala will be called. `resultSchema.forall(_.dataType.isInstanceOf[AtomicType])` is false in that case. Therefore, I removed `assert(vectorizationEnabled)`.
--
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