Uh oh!
There was an error while loading. Please reload this page.
[SPARK-15763][SQL] Support DELETE FILE command natively - #13506
[SPARK-15763][SQL] Support DELETE FILE command natively#13506kevinyu98 wants to merge 34 commits into
Conversation
get latest code from upstream
adding trim characters support
get latest code for pr12646
merge latest code
merge upstream/master
AmplabJenkins
commented
Jun 4, 2016
Can one of the admins verify this patch? |
| * filesystems), or an HTTP, HTTPS or FTP URI. To access the file in Spark jobs, | ||
| * use `SparkFiles.get(fileName)` to find its download location. | ||
| * | ||
| */ |
There was a problem hiding this comment.
this is fairly confusing -- i'd assume this is actually deleting the path given.
There was a problem hiding this comment.
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.
I have updated the deleteFile comments to make it more clear. Thanks for reviewing.
vanzin
commented
Aug 4, 2016
@kevinyu98 Could you update the PR and fix merge conflicts? Thanks |
kevinyu98
commented
Aug 19, 2016
@vanzin Hello Marcelo: I am so sorry that I didn't notice your update. I have fix the merge conflicts and can you help review it? Thanks. |
gatorsmile
commented
Jun 16, 2017
@kevinyu98 Can you please close it? It seems like there is not a lot of interest in adding this functionality natively in Spark. If anybody wants this feature, we can reopen it later? |
kevinyu98
commented
Jun 26, 2017
sure |
gatorsmile
commented
Jun 27, 2017
We are closing it due to inactivity. please do reopen if you want to push it forward. Thanks! |
## What changes were proposed in this pull request? This PR proposes to close stale PRs, mostly the same instances with apache#18017 I believe the author in apache#14807 removed his account. Closesapache#7075Closesapache#8927Closesapache#9202Closesapache#9366Closesapache#10861Closesapache#11420Closesapache#12356Closesapache#13028Closesapache#13506Closesapache#14191Closesapache#14198Closesapache#14330Closesapache#14807Closesapache#15839Closesapache#16225Closesapache#16685Closesapache#16692Closesapache#16995Closesapache#17181Closesapache#17211Closesapache#17235Closesapache#17237Closesapache#17248Closesapache#17341Closesapache#17708Closesapache#17716Closesapache#17721Closesapache#17937 Added: Closesapache#14739Closesapache#17139Closesapache#17445Closesapache#18042Closesapache#18359 Added: Closesapache#16450Closesapache#16525Closesapache#17738 Added: Closesapache#16458Closesapache#16508Closesapache#17714 Added: Closesapache#17830Closesapache#14742 ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closesapache#18417 from HyukjinKwon/close-stale-pr.
What changes were proposed in this pull request?
Hive supports these cli commands to manage the resource Hive Doc :
ADD/DELETE (FILE(s)<filepath..>|JAR(s) <jarpath..>)LIST (FILE(S) [filepath ...] | JAR(S) [jarpath ...])but SPARK only supports two commands
ADD (FILE <filepath> | JAR <jarpath>)LIST (FILE(S) [filepath ...] | JAR(S) [jarpath ...])for now.This PR is to add the DELETE FILE command into Spark SQL and I will submit another PR for the DELETE JAR(s).
DELETE FILE <filepath>Example:
DELETE FILE
How was this patch tested?
Add test cases in Spark-SQL SPARK-Shell and SparkContext suites.
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)