You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2024/08/02 10:20:08 UTC
[PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
yaooqinn opened a new pull request, #47583:
URL: https://github.com/apache/spark/pull/47583
<!--
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
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
ignoreCorruptFiles now applies to all file data sources except for hive orc implementation with mergeSchema off
### 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.
-->
new tests
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->no
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701918449
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
Review Comment:
Shall we mention `mergeSchema`?
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701970747
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
> the previous code doesn't care of OrcOption
mergeSchema is actually from OrcOption for both if and else code branch
https://github.com/apache/spark/pull/47583/files#diff-9954c15e0525a72c38dd8be7eaff4ba6c2a071b216ecea2524419d49ab4f92fcR68-R69
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701966870
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
Unfortunately, no, it's different because the previous code doesn't care of `OrcOption`. I expect the exact request test case, @yaooqinn .
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701921270
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
Review Comment:
Thank you @dongjoon-hyun , addressed
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701962015
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
```scala
Seq(true, false).foreach { mergeSchema =>
checkAnswer(spark.read
.option("mergeSchema", value = mergeSchema)
.option("ignoreCorruptFiles", value = true)
.orc(basePath), Row(0L, 1))
}
```
Using mergeSchema w/ true & false can also achieve your request. I will address this in this way.
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
```scala
Seq(true, false).foreach { mergeSchema =>
checkAnswer(spark.read
.option("mergeSchema", value = mergeSchema)
.option("ignoreCorruptFiles", value = true)
.orc(basePath), Row(0L, 1))
}
```
Using mergeSchema w/ true & false can also achieve your request. I will address this in this way.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2266311536
Thank you, @yaooqinn .
Merged to master/3.5/3.4.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2276921938
BTW, let's be more mindful of the behavior change definition. Even if it's a good and safe user-facing change, we should still document it in the `Does this PR introduce any user-facing change` section. For example, this PR can make queries that failed with corrupted files to run successfully.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2265057737
cc @cloud-fan @dongjoon-hyun @HyukjinKwon thanks in advance
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701961494
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
```scala
Seq(true, false).foreach { mergeSchema =>
checkAnswer(spark.read
.option("mergeSchema", value = mergeSchema)
.option("ignoreCorruptFiles", value = true)
.orc(basePath), Row(0L, 1))
}
```
Using mergeSchema w/ true & false can also achieve your request. I will address this in this way.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2268325751
late LGTM
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701970747
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
> the previous code doesn't care of OrcOption
mergeSchema is actually from OrcOption for both if and else code branches, see
https://github.com/apache/spark/pull/47583/files#diff-9954c15e0525a72c38dd8be7eaff4ba6c2a071b216ecea2524419d49ab4f92fcR68-R69
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701978095
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
Oh, I realized the source of our disagreement. I overlooked the outermost withSQLConf wrapper, which is redundant.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2265655619
BTW, I believe we can convert SPARK-49094 issue to `Bug` instead of `Improvement`.
If you want, you can switch your JIRA issue type and backport this to `branch-3.5` for your 3.5.2 release as the release manager.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701920360
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
Review Comment:
```suggestion
test("SPARK-49094: ignoreCorruptFiles works for hive orc w/ mergeSchema off") {
```
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701927746
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
To be complete, could you add another test case, `SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "false"` without this line?
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701980955
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
Does everything seem to be okay? The test now tests both mergeSchema on and off.
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #47583:
URL: https://github.com/apache/spark/pull/47583#discussion_r1701966870
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala:
##########
@@ -415,4 +415,23 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton {
}
}
}
+
+ test("SPARK-49094: ignoreCorruptFiles works for hive orc") {
+ withSQLConf(SQLConf.ORC_SCHEMA_MERGING_ENABLED.key -> "true") {
+ withTempDir { dir =>
+ val basePath = dir.getCanonicalPath
+ spark.range(0, 1).toDF("a").write.orc(new Path(basePath, "foo=1").toString)
+ spark.range(0, 1).toDF("b").write.json(new Path(basePath, "foo=2").toString)
+
+ withSQLConf(
+ SQLConf.IGNORE_CORRUPT_FILES.key -> "false",
+ SQLConf.ORC_IMPLEMENTATION.key -> "hive") {
+ checkAnswer(spark.read
+ .option("mergeSchema", value = false)
Review Comment:
Unfortunately, no, it's different because the previous code doesn't care of `OrcOption`. I expect the exact requested test case, @yaooqinn .
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #47583: [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off
URL: https://github.com/apache/spark/pull/47583
--
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
Re: [PR] [SPARK-49094][SQL] Fix ignoreCorruptFiles non-functioning for hive orc impl with mergeSchema off [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #47583:
URL: https://github.com/apache/spark/pull/47583#issuecomment-2265662925
It makes sense to me. I will bring this to master/3.5/3.4
--
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