aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2016-11-30 08:17:25 +0100
committerArne H Juul <arnej@yahoo-inc.com>2016-11-30 08:17:25 +0100
commit29ba40ab9d4c21e43b80cb9197e672a9f244fe57 (patch)
tree2eb45105952a7a0a3bd5b653b9f5d93ede701b40 /config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
parent22959dd15d1a9da532739b2d4a207e80bacf49ee (diff)
parent2df45242b26edb39adcb9228a28384a16ba19187 (diff)
Merge branch 'master' into arnej/count-memory-mappings
Conflicts: searchcore/src/vespa/searchcore/proton/metrics/resource_usage_metrics.cpp
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java37
1 files changed, 6 insertions, 31 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
index 19547c5039b..f6a7ddd4983 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
@@ -54,31 +54,6 @@ public class RankingExpressionWithTensorTestCase {
}
@Test
- public void requireThatExpressionWithSingleLineTensorCanBeParsed() throws ParseException {
- SearchFixture f = new SearchFixture(
- " rank-profile my_profile {\n" +
- " first-phase {\n" +
- " expression: sum({ {x:1}:1, {x:2,y:1}:2 })\n" +
- " }\n" +
- " }");
- f.assertFirstPhaseExpression("sum({{x:1}:1.0,{x:2,y:1}:2.0})", "my_profile");
- }
-
- @Test
- public void requireThatExpressionWithMultiLineTensorCanBeParsed() throws ParseException {
- SearchFixture f = new SearchFixture(
- " rank-profile my_profile {\n" +
- " first-phase {\n" +
- " expression {\n" +
- " sum({ {x:1}:1,\n" +
- " {x:2,y:1}:2 })\n" +
- " }\n" +
- " }\n" +
- " }");
- f.assertFirstPhaseExpression("sum({{x:1}:1.0,{x:2,y:1}:2.0})", "my_profile");
- }
-
- @Test
public void requireThatSingleLineConstantTensorAndTypeCanBeParsed() throws ParseException {
SearchFixture f = new SearchFixture(
" rank-profile my_profile {\n" +
@@ -92,7 +67,7 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" }\n" +
" }");
- f.assertFirstPhaseExpression("sum(constant(my_tensor))", "my_profile");
+ f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile");
}
@@ -114,7 +89,7 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" }\n" +
" }");
- f.assertFirstPhaseExpression("sum(constant(my_tensor))", "my_profile");
+ f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile");
}
@@ -132,7 +107,7 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" }\n" +
" }");
- f.assertSecondPhaseExpression("sum(constant(my_tensor))", "my_profile");
+ f.assertSecondPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
}
@@ -152,7 +127,7 @@ public class RankingExpressionWithTensorTestCase {
" expression: sum(my_tensor)\n" +
" }\n" +
" }");
- f.assertFirstPhaseExpression("sum(constant(my_tensor))", "my_profile");
+ f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
}
@@ -174,7 +149,7 @@ public class RankingExpressionWithTensorTestCase {
" }\n" +
" }");
f.assertFirstPhaseExpression("5.0 + my_macro", "my_profile");
- f.assertMacro("sum(constant(my_tensor))", "my_macro", "my_profile");
+ f.assertMacro("reduce(constant(my_tensor), sum)", "my_macro", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
}
@@ -194,7 +169,7 @@ public class RankingExpressionWithTensorTestCase {
" my_number_2: 5.0\n" +
" }\n" +
" }");
- f.assertFirstPhaseExpression("3.0 + sum(constant(my_tensor)) + 5.0", "my_profile");
+ f.assertFirstPhaseExpression("3.0 + reduce(constant(my_tensor), sum) + 5.0", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
}