-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31962][SQL] Provide modifiedAfter and modifiedBefore options when filtering from a batch-based file data source #30411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
154e83b
[SPARK-31962][SQL] Provide modifiedAfter and modifiedBefore options w…
cchighman 80170b4
Address my own review comments
HeartSaVioR 088b630
Make sure the new options only work with batch query (file batch source)
HeartSaVioR 71456f2
checkstyle fix
HeartSaVioR d216fcb
Simply check the count via providing schema instead of checking excep…
HeartSaVioR ce00b6d
Address review comments
HeartSaVioR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
[SPARK-31962][SQL] Provide modifiedAfter and modifiedBefore options w…
…hen filtering from a batch-based file data source
- Loading branch information
commit 154e83b9ca57e8833f00c724cf69ce30c5008e05
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,27 @@ object SQLDataSourceExample { | |
| // |file1.parquet| | ||
| // +-------------+ | ||
| // $example off:load_with_path_glob_filter$ | ||
| // $example on:load_with_modified_time_filter$ | ||
| val beforeFilterDF = spark.read.format("parquet") | ||
| // Files modified before 07/01/2020 at 05:30 are allowed | ||
| .option("modifiedBefore", "2020-07-01T05:30:00") | ||
| .load("examples/src/main/resources/dir1"); | ||
| beforeFilterDF.show(); | ||
| // +-------------+ | ||
| // | file| | ||
| // +-------------+ | ||
| // |file1.parquet| | ||
| // +-------------+ | ||
| val afterFilterDF = spark.read.format("parquet") | ||
| // Files modified after 06/01/2020 at 05:30 are allowed | ||
| .option("modifiedAfter", "2020-06-01T05:30:00") | ||
|
||
| .load("examples/src/main/resources/dir1"); | ||
| afterFilterDF.show(); | ||
| // +-------------+ | ||
| // | file| | ||
| // +-------------+ | ||
| // +-------------+ | ||
| // $example off:load_with_modified_time_filter$ | ||
| } | ||
|
|
||
| private def runBasicDataSourceExample(spark: SparkSession): Unit = { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: two indents to follow the other examples.