beliefer edited a comment on issue #23841: [SPARK-26936][SQL] Fix bug of insert 
overwrite local dir can not create temporary path in local staging directory
URL: https://github.com/apache/spark/pull/23841#issuecomment-477418658
 
 
   > OK it's probably that I don't know this code well. Maybe my question is 
this: when `isLocal == true`, `storage.locationUri` is a local path, so 
`targetPath` points to a local directory. It is now used as a path on 
distributed storage here. It may not exist or be usable that way. Is that OK? 
It may happen to work but seems a little wrong. Or else I am misunderstanding 
how the temp dir gets created and it's not a big deal.
   
   Yes, when `isLocal == true`, `storage.locationUri` is a local path, so 
`targetPath` points to a local directory. It is not used as a path on 
distributed storage here.
   You means targetPath may not exist or be usable that way, so this PR will 
create the local directory explicitly.
   Let me explain in another way:
   `Driver` and `Executor` running in different node(or machine).The `SQL` 
start with `insert overwrite local directory` will write data to a temp path 
first. The original code will use a local temp path.The local temp path is 
valid in node that running `Driver` and it is invalid in node that running 
`Executor`.
   So this PR change the local temp path to a distributed storage path can be 
recognized by Driver and all the `Executor`. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to