scalding icon indicating copy to clipboard operation
scalding copied to clipboard

Proper way to add job-required modules to scald.rb?

Open ljrittle opened this issue 12 years ago • 4 comments

What is the proper way to add e.g. scalding-json (but more generally any of the top-level modules) to a job built and run with sclad.rb ? This is an issue because scald.rb is still documented as a valid way to run scalding jobs but it appears that there is no way to actually add the job-required modules.

Example job:

import com.twitter.scalding.{Job, Args, Tsv, JsonLine}

class parseJson(args: Args) extends Job(args) { JsonLine(args("input"), ('type)).read .groupBy('type){_.size} .write(Tsv(args("output"))) }

fails to build with head develop when scald.rb is run as follows:

$ scald.rb --local parseJson.scala --input session.json --output output.txt

(BTW, the best answer might be: don't use scald.rb anymore now that modules were introduced?)

ljrittle avatar Feb 04 '14 21:02 ljrittle

Note: I hacked my local develop branch to unconditionally find and add scalding-json to allow this example to build and run but it seems (esp. if more modules are to be added for optional scalding feature sets) that a more general system is needed.

ljrittle avatar Feb 04 '14 21:02 ljrittle

fat jar in the canonical way: build a project and use sbt-assembly refer to that with scald.rb.

johnynek avatar Feb 04 '14 23:02 johnynek

Thanks for the response. I see what you mean. However, for local testing and to support adding new tutorial material that uses e.g. json or avro (or the new parquet support), would a small patch to scald.rb be considered if it allowed: --local --json to properly run code that required scalding-json ?

ljrittle avatar Feb 07 '14 19:02 ljrittle

In general, add -- to scald.rb to compile/run the job against the module. E.g. --avro adds the scalding-avro module.

ljrittle avatar Mar 08 '14 06:03 ljrittle