-
Notifications
You must be signed in to change notification settings - Fork 707
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
Add make(dest) to TypedPipe #1217
Conversation
This idea is really nice. People have reimplemented this exact function at least twice internally at Twitter. I agree that shipping this for Local mode but it being broken is not okay. We could either always compute in Local mode (lame) or we could make Local mode properly support validateTaps everywhere. Actually, I didn't know that validateTaps is broken in that case. That deserves its own issue. Do you have more details? |
Yeah, in Local mode @johnynek what do you think of the name, and do we need a variation that returns |
@avibryant I think there is no need for an |
I also like make program :) But will .readOrMake be more informative about what does it do? |
Updated |
@avibryant, thanks for working on this. This will be a great feature. fwiw, it seems like the main use-case for this tool is ad-hoc work in the Scalding REPL(?). The name that would make the most sense to me is .writeOrLoad (or .saveOrLoad) so that the API looks similar to the .write/.save functions. |
@joshualande actually, I hadn't been thinking of REPL use-cases (though that makes sense now that you mention it). I was thinking more about restartable data pipelines with complex dependency graphs - what you might use luigi or oozie for currently. |
@@ -195,6 +195,13 @@ abstract class FileSource extends SchemedSource with LocalSourceOverride { | |||
"[" + this.toString + "] No good paths in: " + hdfsPaths.toString) | |||
} | |||
} | |||
|
|||
case Local(_) => { |
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.
you want Local(true)
here right? strict = true
?
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 guess not. The previous (perhaps questionable) logic is that strict means something is there, but maybe not all the paths. Nothing being present still won't run. Since currently Local only supports one path (even though it could support more), I suppose this is correct.
Ping! Anything else y'all want before this feels ready to merge? ^^ |
Let's shipit! |
closes #1126 |
Changes Unknown when pulling 1314460 on avibryant:avi-make into * on twitter:develop*. |
This allows (very) simple make-like behavior with
Execution
, where awriteThrough
will just turn into a read if the destination already exists.Note that since
validateTaps
isn't defined for local mode, this won't work at all in that context. It may be reasonable to require that to be fixed as part of this PR.Also, it obviously needs a couple of tests before it can be merged.