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/12/28 08:03:05 UTC
[GitHub] [spark] yym1995 opened a new pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
yym1995 opened a new pull request #35038:
URL: https://github.com/apache/spark/pull/35038
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
This is the patch on branch-3.2 for #35002. See the description in the other PR.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
Bugfix
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
Added unit test in OrcSourceSuite.scala
--
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
[GitHub] [spark] AmplabJenkins commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1002160049
Can one of the admins verify this patch?
--
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
[GitHub] [spark] dongjoon-hyun commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1003191482
It fails in my local environment, too.
```
[info] - SPARK-37728: Reading nested columns with ORC vectorized reader should not cause ArrayIndexOutOfBoundsException *** FAILED *** (1 second, 522 milliseconds)
[info] vectorizationEnabled was false (OrcQuerySuite.scala:734)
[info] org.scalatest.exceptions.TestFailedException:
```
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776184302
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
- First of all, this PR is a fix for SPARK-37728. Please don't make it mix with the other JIRA although that is the root cause of your JIRA.
- Second, yes. You are ignoring my comment about test coverage, `Please recover the test coverage like the original PR`. Do you have another reason to remove a test coverage?
--
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
[GitHub] [spark] dongjoon-hyun commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1002738069
Could you re-trigger GitHub Action job to make it sure it pass?
--
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
[GitHub] [spark] dongjoon-hyun commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1002823712
cc @williamhyun , too
--
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
[GitHub] [spark] dongjoon-hyun closed pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #35038:
URL: https://github.com/apache/spark/pull/35038
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777804588
##########
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:
> Why did you remove, `assert(vectorizationEnabled)`, here, which is differently from the master branch? It looks like a removal of important test coverage again.
>
> Since this test case is about `Reading nested columns with ORC vectorized reader ...`, you should not remove it. Did I miss something here?
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776184302
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
- First of all, this PR is a fix for SPARK-37728. Please don't make it mix with the other JIRA although that is the root cause of your JIRA.
- Second, yes. It's for my previous comment, "Please recover the test coverage like the original PR". Do you have another reason to remove a test coverage?
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776285685
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
> * First of all, this PR is a fix for [SPARK-37728](https://issues.apache.org/jira/browse/SPARK-37728). Please don't make it mix with the other JIRA although that is the root cause of your JIRA.
> * Second, yes. It's for my previous comment, "Please recover the test coverage like the original PR". Do you have another reason to remove a test coverage?
OK. Now I moved this unit test case to OrcQuerySuite.scala.
--
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
[GitHub] [spark] c21 commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
c21 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776614195
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
Yeah I confirm we need to create unit test in `OrcQuerySuite.scala` instead. Just for context, I moved the unit test from `OrcSourceSuite` to `OrcQuerySuite` when adding support for DSv2 - https://github.com/apache/spark/pull/33626 . Thanks for @dongjoon-hyun pointing it out.
--
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
[GitHub] [spark] c21 commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
c21 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776614195
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
Yeah I confirm we need to create unit test in `OrcQuerySuite.scala` instead. Just for context, I moved the unit test from `OrcSourceSuite` to `OrcQuerySuite` when adding support for DSv2 - https://github.com/apache/spark/pull/33842 . Thanks for @dongjoon-hyun pointing it out.
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r778253991
##########
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:
Got it. Thank you for the background, @yym1995 .
--
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
[GitHub] [spark] yym1995 commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
yym1995 commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1002036178
cc @dongjoon-hyun
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776184302
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
- First of all, this PR is a fix for SPARK-37728. Please don't make it mix with the other JIRA although that is the root cause of your JIRA.
- Second, yes. You are ignoring my comment about test coverage, "Please recover the test coverage like the original PR". Do you have another reason to remove a test coverage?
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777804859
##########
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:
> Why did you remove, `assert(vectorizationEnabled)`, here, which is differently from the master branch? It looks like a removal of important test coverage again.
>
> Since this test case is about `Reading nested columns with ORC vectorized reader ...`, you should not remove it. Did I miss something here?
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])` will return 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
[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
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777045090
##########
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:
Why did you remove, `assert(vectorizationEnabled)`, here, which is differently from the master branch? It looks like a removal of important test coverage again.
Since this test case is about `Reading nested columns with ORC vectorized reader ...`, you should not remove it. Did I miss something here?
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777804859
##########
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:
> Why did you remove, `assert(vectorizationEnabled)`, here, which is differently from the master branch? It looks like a removal of important test coverage again.
>
> Since this test case is about `Reading nested columns with ORC vectorized reader ...`, you should not remove it. Did I miss something here?
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])` will return false in that case. Therefore, I removed `assert(vectorizationEnabled)`.
To fix this issue, I think https://github.com/apache/spark/pull/33626 should also be backported to branch-3.2.
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776160789
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
What I meant was that this should be in `OrcQuerySuite` instead of `OrcSourceSuite` to provide a test coverage for v1 and v2.
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776170676
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
> What I meant was that this should be in `OrcQuerySuite` instead of `OrcSourceSuite` to provide a test coverage for v1 and v2.
This PR is a fix for [SPARK-34862]. The unit test "SPARK-34862: Support ORC vectorized reader for nested column" is in OrcSourceSuite.scala on branch-3.2. That's why I put my unit test in OrcSourceSuite.scala. Do you think I should put it in OrcQuerySuite.scala?
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776952835
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala
##########
@@ -713,6 +715,29 @@ 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",
+ SQLConf.WHOLESTAGE_MAX_NUM_FIELDS.key -> "10000") {
Review comment:
Indentation? We need two more spaces.
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r777045090
##########
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:
Why do you remove, `assert(vectorizationEnabled)`, here? It looks like a removal of important test coverage again.
Since this test case is about `Reading nested columns with ORC vectorized reader ...`, you should not remove it. Did I miss something here?
--
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
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776184302
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
- First of all, this PR is a fix for SPARK-37728. Please don't make it mix with the other JIRA although that is the root cause of your JIRA.
- Second, no. You are ignoring my comment about test coverage, `Please recover the test coverage like the original PR`.
--
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
[GitHub] [spark] dongjoon-hyun commented on pull request #35038: [SPARK-37728][SQL][3.2] Reading nested columns with ORC vectorized reader can cause ArrayIndexOutOfBoundsException
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35038:
URL: https://github.com/apache/spark/pull/35038#issuecomment-1002280592
Let me revise your PR description.
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776170786
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
> What I meant was that this should be in `OrcQuerySuite` instead of `OrcSourceSuite` to provide a test coverage for v1 and v2.
This PR is a fix for [SPARK-34862]. The unit test "SPARK-34862: Support ORC vectorized reader for nested column" is in OrcSourceSuite.scala on branch-3.2. That's why I put my unit test in OrcSourceSuite.scala. Do you think I should put it in OrcQuerySuite.scala?
--
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
[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
Posted by GitBox <gi...@apache.org>.
yym1995 commented on a change in pull request #35038:
URL: https://github.com/apache/spark/pull/35038#discussion_r776170379
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala
##########
@@ -644,6 +645,28 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession {
}
}
+ test("SPARK-37728: Reading nested columns with ORC vectorized reader should not " +
Review comment:
This PR is a fix for [SPARK-34862]. The unit test "SPARK-34862: Support ORC vectorized reader for nested column" is in OrcSourceSuite.scala on branch-3.2. That's why I put my unit test in OrcSourceSuite.scala. Do you think I should put it in OrcQuerySuite.scala?
--
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