use Number instead of long for response context#8342
Merged
gianm merged 4 commits intoapache:masterfrom Aug 21, 2019
Merged
Conversation
…on serde to int or long
Contributor
|
Is it possible to add a test? |
ccaominh
reviewed
Aug 20, 2019
| Assert.assertEquals("string-value", ctx.get(ResponseContext.Key.ETAG)); | ||
| Assert.assertEquals(100, ctx.get(ResponseContext.Key.NUM_SCANNED_ROWS)); | ||
| ctx.add(ResponseContext.Key.NUM_SCANNED_ROWS, 10L); | ||
| Assert.assertEquals(110L, ctx.get(ResponseContext.Key.NUM_SCANNED_ROWS)); |
Contributor
There was a problem hiding this comment.
Is it possible to add a similar assert for CPU_CONSUMED_NANOS?
Member
Author
There was a problem hiding this comment.
the code is equivalent making a test sort of redundant, but yes anything is possible.
Contributor
There was a problem hiding this comment.
It's still useful as a regression test, IMO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue with scan queries introduced by #8157, which I believe is caused by variation in JSON serde of the response context, and switches
NUM_SCANNED_ROWSandCPU_CONSUMED_NANOSto cast toNumberand useNumber.longValueinstead of casting tolongprimitive, to avoid errors of the form:which result eventually in the broker failing to return a result:
This issue is repeatable by having a broker and 2 historical servers with the example wikipedia batch dataset, and issuing a
SELECT * FROM "wikipedia".After this fix the query successfully returns results.
This PR has: