-
Notifications
You must be signed in to change notification settings - Fork 81
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
gRPC error: ColumnAggregations should have at least two pairs #3235
Comments
It looks like this aggregation is being created with zero columns. I can add a better error message. The case of 1 column should already be handled by this codepath. @niloc132 |
The error message could be improved from the Take a look at GrpcErrorHelper.checkRepeatedFieldNonEmpty(columns, AggregationColumns.MATCH_PAIRS_FIELD_NUMBER); |
Provides better developer experience, see deephaven#3235
I'm able to create an agg with two columns, but not with one. See the checkSize():
|
@niloc132, that's by design, but I think you are running into other issues with the client code. In your stacktrace, If you want to merge in #3242, hopefully that provides a better error message to validate what I think the stacktrace is showing. |
I understand that it is by design, I am saying the design is bad. I'm creating this from a client in js, and suggesting that python will have the same problem, since the server could trivially handle this case (just as the java api wrapper does), but elects to instead throw an exception. |
I will admit to being nearly as annoyed by this validation as @niloc132 was, although in most cases users of the Java |
Okay. Is this ticket purely a "bad design" ticket, or do we think there is an actual server bug? B/c from everything I can see, it looks like the client is trying to construct a request with 0 pairs (I expect 1+ pairs to work). |
It is looking like the mistake was mine, as I can't reproduce it now, and don't see an obvious change in this area that would have fixed this. It had appeared that I was able to reproduce this only via gRPC, but that the Java api somehow normalized this away only for Java calls (where I would have expected that this could serve as a nacent qst-driven optimization). I do get a different error if I send zero match pairs:
which leads me to suspect that there was at least one bug at the time I wrote the original report ( |
Provides better developer experience, see #3235
When implementing the JS API for aggregations, the consistent UI is to let the user build a list of aggregations (at least one), and so in turn the API behind the UI will take at least one aggregation and translate that list into an aggregation object to send to the server.
However, the server emits only
Internal Error: Details Logged w/ID '5d9df6ae-e6b6-482e-90fe-9ae7771c20c3'
when this happens. The server error is actually:While technically this is true, it is a lot like making
Arrays.asList(...)
throw an exception that you should have usedCollections.singletonList(...)
- your IDE's static analysis will detect this and it certainly will warn (or error, if so configured), but forcing a runtime error based on the length of the list seems silly.As it stands, the JS client has to either force through its API that aggregations of 1 column must use a different method, or must count the elements in the collection and build output differently, instead of the trivial server unwrapping that could take place. Python almost certainly will have the same issue, and given the Java example above, I suspect any java client would reasonably object here as well.
The text was updated successfully, but these errors were encountered: