Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast Aggregations on [any] operator on empty array does not work #10126

Closed
asimarslan opened this issue Mar 21, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@asimarslan
Copy link
Member

commented Mar 21, 2017

For builtin aggregations like Count, LongSum etc.
If we used them with an attributePath on list/array field like;

class Person implements Portable {
...
    int[] valueArray;
...
}

if we initialize valueArray with an empty arrayvalueArray = new int[]{};

map.aggregate(Aggregators.<Map.Entry<Integer, Person>>integerSum.integerSum("valueArray[any]"));

throws NullPointerException instead of returning 0,

map.aggregate(Aggregators.<Map.Entry<Integer, Person>>count("valueArray[any]"));

returns 1 instead of 0.

Other builtin aggregators may also fail, they should be tested.

@tombujok

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2017

Confirmed, the spec test does not test on empty arrays with [any] operator.

@tombujok

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2017

With the current design of the AbstractMultiValue getter it is impossible to support in-built fast-aggregations with the [any] operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.