Created
September 5, 2013 14:56
-
-
Save tomtau/6451278 to your computer and use it in GitHub Desktop.
Generated job using the new Matrix API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.twitter.scalding._ | |
import cascading.pipe.joiner._ | |
import com.twitter.scalding.mathematics.Matrix2 | |
import com.twitter.scalding.mathematics.FiniteHint | |
import com.twitter.algebird.Group | |
class BenchNewJob(args : Args) extends Job(args) { | |
import Matrix2._ | |
import com.twitter.scalding.mathematics.MatrixLiteral | |
import cascading.pipe.Pipe | |
import cascading.tuple.Fields | |
import com.twitter.scalding.TDsl._ | |
val p0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) ) | |
.read | |
val tp0 = p0.toTypedPipe[(Int, Int, Double)](('x,'y,'v)) | |
val a0 = MatrixLiteral(tp0, FiniteHint(100, 100)) | |
val p1 = Tsv("/home/ttauber/scalding-bench/a1.tsv", ('x, 'y, 'v) ) | |
.read | |
val tp1 = p1.toTypedPipe[(Int, Int, Double)](('x,'y,'v)) | |
val a1 = MatrixLiteral(tp1, FiniteHint(100, 100)) | |
val p2 = Tsv("/home/ttauber/scalding-bench/a2.tsv", ('x, 'y, 'v) ) | |
.read | |
val tp2 = p2.toTypedPipe[(Int, Int, Double)](('x,'y,'v)) | |
val a2 = MatrixLiteral(tp2, FiniteHint(100, 100)) | |
((a0 * a1) + a2).toTypedPipe.write( TypedTsv[(Int, Int, Double)]("/home/ttauber/scalding-bench/anew.tsv")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment