Skip to content
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

[SPARK-6067][SQL]delete the file with the same name before create the path for HiveFileFormatUtils.getHiveRecordWriter #4980

Closed
wants to merge 3 commits into from

Conversation

baishuo
Copy link
Contributor

@baishuo baishuo commented Mar 11, 2015

@baishuo
Copy link
Contributor Author

baishuo commented Mar 11, 2015

I think this patch should test by the Reporter of SPARK-6067

@marmbrus
Copy link
Contributor

marmbrus commented Apr 3, 2015

ok to test

@marmbrus
Copy link
Contributor

marmbrus commented Apr 3, 2015

/cc @liancheng

@SparkQA
Copy link

SparkQA commented Apr 3, 2015

Test build #29636 has finished for PR 4980 at commit 5283708.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

val path = new Path(workPath, getOutputName)
val fs = path.getFileSystem(conf.value)
// this judgement is added for SPARK-6067
if (fs.exists(path) && path.toUri.toString.indexOf("part-") > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check for part- before getting a file system or checking if the file exists. This saves RPCs.
Did you mean > 0 in the sense of contains? that's not quite correct if so, since the condition should be >= 0. But then contains would be simpler anyway.
Finally, duplicat -> duplicate

@baishuo
Copy link
Contributor Author

baishuo commented Apr 23, 2015

thank you @srowen

@SparkQA
Copy link

SparkQA commented Apr 23, 2015

Test build #30804 has finished for PR 4980 at commit 4d5f65c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@SparkQA
Copy link

SparkQA commented Apr 27, 2015

Test build #31055 has started for PR 4980 at commit 4d5f65c.

@baishuo baishuo changed the title [SPARK-6067][SQL][WIP]delete the file with the same name before create the path for HiveFileFormatUtils.getHiveRecordWriter [SPARK-6067][SQL]delete the file with the same name before create the path for HiveFileFormatUtils.getHiveRecordWriter Apr 28, 2015
val path = new Path(workPath, getOutputName)
val fs = path.getFileSystem(conf.value)
// this judgement is added for SPARK-6067
if (fs.exists(path) && path.toUri.toString.contains("part-")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @srowen mentioned, please check "part-" first, and then check existence, to save NameNode RPC.

@SparkQA
Copy link

SparkQA commented Apr 29, 2015

Test build #31228 has finished for PR 4980 at commit d4f145e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@baishuo
Copy link
Contributor Author

baishuo commented Apr 30, 2015

can this patch be merged?:)

@andrewor14
Copy link
Contributor

@liancheng can this patch be merged? Is it still relevant?

@baishuo
Copy link
Contributor Author

baishuo commented Sep 9, 2015

hi @andrewor14 @liancheng , I think this is a useful patch :)

@liancheng
Copy link
Contributor

Seems that this issue has already fixed by #6833?

@andrewor14
Copy link
Contributor

Shall we close this PR then?

@baishuo
Copy link
Contributor Author

baishuo commented Sep 19, 2015

no problem. close it :) @andrewor14 @liancheng

@baishuo baishuo closed this Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants