diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-08-14 11:15:12 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-08-14 11:15:12 +0200 |
commit | 7b134d8ef30cc3bd6e0867ba3f47452d78d4fce0 (patch) | |
tree | 96ef67d3c9998c0f51c289d1e8cfb298b26f0e2f /container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java | |
parent | 216feb84a135cbcd3e20cdb3240a63fdb53439e3 (diff) |
Fix Select and grouping bugs
- Deep copy the grouping structure on query copy.
It is mutable but we have neglected doing this right until now.
- Fix a bug in the previous commit where the last constructed Query.Model was shared between all instances.
- Fix a bug in the previous commit where the query string instead of the query tree was reset when a new select
expression is set.
- Don't use deprecated method.
- Clean up Javadoc and formatting.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java b/container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java index 3c1c335b8ef..2f32b0fe139 100644 --- a/container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java +++ b/container-search/src/main/java/com/yahoo/search/grouping/request/ToRawFunction.java @@ -8,7 +8,8 @@ import java.util.Arrays; * converts the result of the argument to a raw type. If the argument can not * be converted, this function returns null. * - * @author <a href="mailto:lulf@yahoo-inc.com">Ulf Lilleengen</a> + * @author Ulf Lilleengen + * @author bratseth */ public class ToRawFunction extends FunctionNode { @@ -18,6 +19,16 @@ public class ToRawFunction extends FunctionNode { * @param exp The expression to evaluate. */ public ToRawFunction(GroupingExpression exp) { - super("toraw", Arrays.asList(exp)); + this(null, null, exp); } + + private ToRawFunction(String label, Integer level, GroupingExpression exp) { + super("toraw", label, level, Arrays.asList(exp)); + } + + @Override + public ToRawFunction copy() { + return new ToRawFunction(getLabel(), getLevelOrNull(), getArg(0).copy()); + } + } |