-
Couldn't load subscription status.
- Fork 28.9k
[SPARK-15763][SQL] Support DELETE FILE command natively #13506
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 all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3b44c59
adding testcase
kevinyu98 18b4a31
Merge remote-tracking branch 'upstream/master'
kevinyu98 4f4d1c8
Merge remote-tracking branch 'upstream/master'
kevinyu98 f5f0cbe
Merge remote-tracking branch 'upstream/master'
kevinyu98 d8b2edb
Merge remote-tracking branch 'upstream/master'
kevinyu98 196b6c6
Merge remote-tracking branch 'upstream/master'
kevinyu98 f37a01e
Merge remote-tracking branch 'upstream/master'
kevinyu98 bb5b01f
Merge remote-tracking branch 'upstream/master'
kevinyu98 bde5820
Merge remote-tracking branch 'upstream/master'
kevinyu98 5f7cd96
Merge remote-tracking branch 'upstream/master'
kevinyu98 893a49a
Merge remote-tracking branch 'upstream/master'
kevinyu98 4bbe1fd
Merge remote-tracking branch 'upstream/master'
kevinyu98 b2dd795
Merge remote-tracking branch 'upstream/master'
kevinyu98 8c3e5da
Merge remote-tracking branch 'upstream/master'
kevinyu98 a0eaa40
Merge remote-tracking branch 'upstream/master'
kevinyu98 d03c940
Merge remote-tracking branch 'upstream/master'
kevinyu98 d728d5e
Merge remote-tracking branch 'upstream/master'
kevinyu98 ea104dd
Merge remote-tracking branch 'upstream/master'
kevinyu98 6ab1215
Merge remote-tracking branch 'upstream/master'
kevinyu98 0c56653
Merge remote-tracking branch 'upstream/master'
kevinyu98 d7a1874
Merge remote-tracking branch 'upstream/master'
kevinyu98 85d3500
Merge remote-tracking branch 'upstream/master'
kevinyu98 c056f91
Merge remote-tracking branch 'upstream/master'
kevinyu98 6dd6ca9
fix7
kevinyu98 0b8189d
Merge remote-tracking branch 'upstream/master'
kevinyu98 527749d
Merge branch 'spark-deletefile' into spark-15763
kevinyu98 c2ea31d
Merge remote-tracking branch 'upstream/master'
kevinyu98 8767570
fix comments for deleteFile
kevinyu98 a2d3056
Merge remote-tracking branch 'upstream/master'
kevinyu98 39e5648
Merge remote-tracking branch 'upstream/master'
kevinyu98 b9370a3
Merge remote-tracking branch 'upstream/master'
kevinyu98 01224a4
Merge remote-tracking branch 'upstream/master'
kevinyu98 d05d39a
Merge remote-tracking branch 'upstream/master'
kevinyu98 d38a412
Merge branch 'spark-15763' into spark-15763new
kevinyu98 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
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
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
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.
this is fairly confusing -- i'd assume this is actually deleting the path given.
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.
Hi Reynold: Thanks very much for reviewing the code.
yes, it is deleting the path from the addedFile hashmap, the path will be generated as key and stored in the map.
The addFile use this logical to generate the key and stored in the hashmap, so in order to find the same key, I have to use the same logical to generate the key.
For example:
for this local file, the addFile will generate a 'file' in front of the path.
spark.sql("add file /Users/qianyangyu/myfile.txt")
scala> spark.sql("list file").show(false)
+----------------------------------+
|Results |
+----------------------------------+
|file:/Users/qianyangyu/myfile2.txt|
|file:/Users/qianyangyu/myfile.txt |
+----------------------------------+
but for the remote location file, it will just take the path.
scala> spark.sql("add file hdfs://bdavm009.svl.ibm.com:8020/tmp/test.txt")
res17: org.apache.spark.sql.DataFrame = []
scala> spark.sql("list file").show(false)
+---------------------------------------------+
|Results |
+---------------------------------------------+
|file:/Users/qianyangyu/myfile.txt |
|hdfs://bdavm009.svl.ibm.com:8020/tmp/test.txt|
+---------------------------------------------+
if the command is issued from the worker node and add local file, the path will be added into the NettyStreamManager's hashmap and using that environment's path as key to store in the addedFiles.
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.
I have updated the deleteFile comments to make it more clear. Thanks for reviewing.