summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com/yahoo/tensor/functions
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-01-06 17:09:05 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2017-01-06 17:09:05 +0100
commit21d75fade74539121c0283fb154efdc09fa886f3 (patch)
treecb432c9203b92896b177c3762e2c42bd383a65b5 /vespajlib/src/test/java/com/yahoo/tensor/functions
parent27cdc6fb1fddf7127710312d8fd881a9aec8100f (diff)
Faster indexed general join algorithm
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/functions')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/functions/JoinTestCase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/functions/JoinTestCase.java b/vespajlib/src/test/java/com/yahoo/tensor/functions/JoinTestCase.java
index f2b55c74066..bc2d1f21717 100644
--- a/vespajlib/src/test/java/com/yahoo/tensor/functions/JoinTestCase.java
+++ b/vespajlib/src/test/java/com/yahoo/tensor/functions/JoinTestCase.java
@@ -34,4 +34,15 @@ public class JoinTestCase {
t2.divide(t1));
}
+ @Test
+ public void testGeneralJoin() {
+ assertEquals(Tensor.from("tensor(x[],y[]):{ {x:0,y:0}:1, {x:1,y:0}:2, {x:2,y:0}:3 }"),
+ Tensor.from("tensor(x[]):{ {x:0}:2, {x:1}:4, {x:2}:6 }")
+ .divide(Tensor.from("tensor(y[]):{{y:0}:2}")));
+
+ assertEquals(Tensor.from("tensor(x[],y[],z[]):{ {x:0,y:0,z:0}:3, {x:1,y:0,z:0}:4, {x:0,y:1,z:0}:5, {x:1,y:1,z:0}:6 }"),
+ Tensor.from("tensor(x[],y[]):{ {x:0,y:0}:6, {x:1,y:0}:8, {x:0,y:1}:20, {x:1,y:1}:24 }")
+ .divide(Tensor.from("tensor(y[],z[]):{ {y:0,z:0}:2, {y:1,z:0}:4, {y:2,z:0}:6 }")));
+ }
+
}