diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-08-15 15:11:38 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-08-15 15:11:38 +0200 |
commit | 3ad3382721036e58dab67a0d2cc79dfa93263087 (patch) | |
tree | 317f08cb4cb2b21879ed6380b242c2104daa698c /container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java | |
parent | 506ea9c1367748ddd4ff20203fc13211d635f5a6 (diff) |
Revert "Merge pull request #6582 from vespa-engine/revert-6557-revert-6553-revert-6512-henrhoi/object-structured-grouping"
This reverts commit 506ea9c1367748ddd4ff20203fc13211d635f5a6, reversing
changes made to 4f6b34dcf9ad904f0ddb89eb506f5920360d5344.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java b/container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java index 5e51c8e35a0..dddc3df0542 100644 --- a/container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java +++ b/container-search/src/main/java/com/yahoo/search/grouping/request/CatFunction.java @@ -2,12 +2,14 @@ package com.yahoo.search.grouping.request; import java.util.List; +import java.util.stream.Collectors; /** * This class represents a cat-function in a {@link GroupingExpression}. It evaluates to a byte array that equals the * concatenation of the binary result of all arguments in the order they were given to the constructor. * * @author Simon Thoresen Hult + * @author bratseth */ public class CatFunction extends FunctionNode { @@ -19,11 +21,18 @@ public class CatFunction extends FunctionNode { * @param argN The optional arguments. */ public CatFunction(GroupingExpression arg1, GroupingExpression arg2, GroupingExpression... argN) { - this(asList(arg1, arg2, argN)); + this(null, null, asList(arg1, arg2, argN)); } - private CatFunction(List<GroupingExpression> args) { - super("cat", args); + private CatFunction(String label, Integer level, List<GroupingExpression> args) { + super("cat", label, level, args); + } + + @Override + public CatFunction copy() { + return new CatFunction(getLabel(), + getLevelOrNull(), + args().stream().map(arg -> arg.copy()).collect(Collectors.toList())); } /** @@ -37,6 +46,6 @@ public class CatFunction extends FunctionNode { if (args.size() < 2) { throw new IllegalArgumentException("Expected 2 or more arguments, got " + args.size() + "."); } - return new CatFunction(args); + return new CatFunction(null, null, args); } } |