diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-08-21 21:28:18 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-08-21 21:28:18 -0700 |
commit | 9c2324d1b32116dc3a8a0f43c08ee7dac1bdf5f4 (patch) | |
tree | 1f3b264118c437130c8a676d560152b0ff9abf07 /scalding/src/main | |
parent | e99c1d8485ee232d782d2b82c44dc9e1d0e01044 (diff) | |
parent | 2f8a538fb658b3de6bf7c9361bd13f2eb7968abb (diff) | |
download | sandcrawler-9c2324d1b32116dc3a8a0f43c08ee7dac1bdf5f4.tar.gz sandcrawler-9c2324d1b32116dc3a8a0f43c08ee7dac1bdf5f4.zip |
Merge branch 'bnewbold-match-scale'
Diffstat (limited to 'scalding/src/main')
-rw-r--r-- | scalding/src/main/scala/sandcrawler/ScoreJob.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scalding/src/main/scala/sandcrawler/ScoreJob.scala b/scalding/src/main/scala/sandcrawler/ScoreJob.scala index 75d45e9..28e9132 100644 --- a/scalding/src/main/scala/sandcrawler/ScoreJob.scala +++ b/scalding/src/main/scala/sandcrawler/ScoreJob.scala @@ -13,15 +13,18 @@ class ScoreJob(args: Args) extends JobBase(args) { val pipe1 : TypedPipe[(String, ReduceFeatures)] = sc1.getInputPipe(args) val pipe2 : TypedPipe[(String, ReduceFeatures)] = sc2.getInputPipe(args) - pipe1.join(pipe2).map { entry => - val (slug : String, (features1 : ReduceFeatures, features2 : ReduceFeatures)) = entry - new ReduceOutput( + pipe1 + .addTrap(TypedTsv(args("output") + ".trapped")) + .join(pipe2) + .map { entry => + val (slug : String, (features1 : ReduceFeatures, features2 : ReduceFeatures)) = entry + new ReduceOutput( slug, Scorable.computeSimilarity(features1, features2), features1.json, features2.json) - } - //TypedTsv doesn't work over case classes. + } + //TypedTsv doesn't work over case classes. .map { entry => (entry.slug, entry.score, entry.json1, entry.json2) } .write(TypedTsv[(String, Int, String, String)](args("output"))) } |