forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48649][SQL] Add "ignoreInvalidPartitionPaths" and "spark.sql.f…
…iles.ignoreInvalidPartitionPaths" configs to allow ignoring invalid partition paths ### What changes were proposed in this pull request? This PR adds a new data source config `ignoreInvalidPartitionPaths` and SQL session configuration flag `spark.sql.files.ignoreInvalidPartitionPaths` to control the behaviour of skipping invalid partition paths (base paths). When the config is enabled, it allows skipping invalid paths such as: ``` table/ invalid/... part=1/... part=2/... part=3/... ``` In this case, `table/invalid` path will be ignored. Data source option takes precedence over the SQL config so with the code: ```scala spark.conf.set("spark.sql.files.ignoreInvalidPartitionPaths", "false") spark.read.format("parquet").option("ignoreInvalidPartitionPaths", "true").load(...) ``` the query would ignore invalid partitions, i.e. the flag will be enabled. The config is disabled by default. ### Why are the changes needed? Allows ignoring invalid partition paths that cannot be parsed. ### Does this PR introduce _any_ user-facing change? No. The added configs are disabled by default to have the exact same behaviour as before. ### How was this patch tested? I added a unit test for this. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47006 from sadikovi/SPARK-48649. Authored-by: Ivan Sadikov <ivan.sadikov@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information
Showing
6 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters