GroupBy: Validation of output names, and a gross hack for v1 subqueries.#3686
GroupBy: Validation of output names, and a gross hack for v1 subqueries.#3686nishantmonu51 merged 1 commit intoapache:masterfrom
Conversation
|
Closing for now since this will conflict with #3685. |
33eab40 to
8048b9b
Compare
|
Don't merge until #3685 is merged; this one is rebased off that. |
8048b9b to
0791c49
Compare
|
@gianm this now has conflicts |
|
👍 but FWIW, groupby v1 is dead to me |
There was a problem hiding this comment.
A small thing: toArray(new T[0]) is a better default choice now, see https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion, "Bottom line" section.
There was a problem hiding this comment.
Oh, that's kind of surprising and good to know.
0791c49 to
0841689
Compare
|
Rebased |
v1 subqueries try to use aggregators to "transfer" values from the inner results to an incremental index, but aggregators can't transfer all kinds of values (strings are a common one). This is a workaround that selectively ignores what the outer aggregators ask for and instead assumes that we know best. These are in the same commit because the name validation changed the kinds of errors that were thrown by v1 subqueries.
0841689 to
6bff8aa
Compare
nishantmonu51
left a comment
There was a problem hiding this comment.
few comments for log messages, otherwise seems good.
|
|
||
| for (AggregatorFactory aggregator : aggregators) { | ||
| if (!outputNames.add(aggregator.getName())) { | ||
| throw new IAE("Duplicate output name[%s]", aggregator.getName()); |
There was a problem hiding this comment.
change log message to "Duplicate Aggregator name[%s]"
There was a problem hiding this comment.
I think that message would be misleading - the duplicate name might be a dimension and aggregator with the same name, not two aggregators.
|
|
||
| for (PostAggregator postAggregator : postAggregators) { | ||
| if (!outputNames.add(postAggregator.getName())) { | ||
| throw new IAE("Duplicate output name[%s]", postAggregator.getName()); |
There was a problem hiding this comment.
Similar comment to above
|
@nishantmonu51 any more comments? |
…es. (apache#3686) v1 subqueries try to use aggregators to "transfer" values from the inner results to an incremental index, but aggregators can't transfer all kinds of values (strings are a common one). This is a workaround that selectively ignores what the outer aggregators ask for and instead assumes that we know best. These are in the same commit because the name validation changed the kinds of errors that were thrown by v1 subqueries.
Prevents having dimensions, aggregators, or postaggregators with the same name as each other. In the past they would have clobbered each other, which would lead to unexpected query results.