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

TypedTSV overwrite existing folder on hdfs #1893

Open
vsacheti opened this issue Jan 9, 2019 · 0 comments
Open

TypedTSV overwrite existing folder on hdfs #1893

vsacheti opened this issue Jan 9, 2019 · 0 comments

Comments

@vsacheti
Copy link

vsacheti commented Jan 9, 2019

we recently found some of our folder were accidently deleted, and on doing more research, I found TypedTSV overwrites the folder if it already exists. I used the following simple script to test it.

val inputPath = args("input")
  val outputPath = args("output")
  val output = TypedPipe.from(TextLine(inputPath))
                        .map(p => p + 10)
  output.write(TypedTsv(outputPath))

I ran the above script with the arguments something like --hdfs --input in1 --output out1 where in1 and out1 are folders on hdfs

I was doing more research on this, from the following link I found the default behavior should be KEEP.
http://docs.cascading.org/cascading/1.2/userguide/html/ch03s03.html

Here is the excerpt from the above link

SinkMode.KEEP
This is the default behavior. If the resource exists, attempting to write to it will fail.

I am little confused as I dont see SinkMode as a parameter to TypedTSV constructor, so maybe I am mixing two unrelated things.

But fundamentally things should not get deleted.

Will really appreciate if somebody can look at this and probably explain the above behavior.

Thanks

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

No branches or pull requests

1 participant