This is an automated email from the ASF dual-hosted git repository.
yangjie01 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new a474b88aa2eb [SPARK-48724][SQL][TESTS] Fix incorrect conf settings of
`ignoreCorruptFiles` related tests case in `ParquetQuerySuite`
a474b88aa2eb is described below
commit a474b88aa2ebb2af17273975f2f91584c0ce9af1
Author: Wei Guo <[email protected]>
AuthorDate: Wed Jun 26 19:30:52 2024 +0800
[SPARK-48724][SQL][TESTS] Fix incorrect conf settings of
`ignoreCorruptFiles` related tests case in `ParquetQuerySuite`
### What changes were proposed in this pull request?
This PR aims to fix incorrect conf settings of `ignoreCorruptFiles` related
tests case in `ParquetQuerySuite`. The inner `withSQLConf
(SQLConf.IGNORE_CORRUPT_FILES.key -> "false")` will overwrite the outer
configuration, making it impossible to test the situation where `sqlConf` is
true.
### Why are the changes needed?
Fix test coverage logic.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass GA.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #47088 from wayneguow/parquet_query_suite.
Authored-by: Wei Guo <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
---
.../datasources/parquet/ParquetQuerySuite.scala | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala
index a329d3fdc3cb..4d413efe5043 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala
@@ -369,16 +369,14 @@ abstract class ParquetQuerySuite extends QueryTest with
ParquetTest with SharedS
}
withSQLConf(SQLConf.IGNORE_CORRUPT_FILES.key -> sqlConf) {
- withSQLConf(SQLConf.IGNORE_CORRUPT_FILES.key -> "false") {
- val exception = intercept[SparkException] {
- testIgnoreCorruptFiles(options)
- }.getCause
- assert(exception.getMessage().contains("is not a Parquet file"))
- val exception2 = intercept[SparkException] {
- testIgnoreCorruptFilesWithoutSchemaInfer(options)
- }.getCause
- assert(exception2.getMessage().contains("is not a Parquet file"))
- }
+ val exception = intercept[SparkException] {
+ testIgnoreCorruptFiles(options)
+ }.getCause
+ assert(exception.getMessage().contains("is not a Parquet file"))
+ val exception2 = intercept[SparkException] {
+ testIgnoreCorruptFilesWithoutSchemaInfer(options)
+ }.getCause
+ assert(exception2.getMessage().contains("is not a Parquet file"))
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]