-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix serde for ArrayOfDoublesSketchConstantPostAggregator. #16550
Conversation
The version originally added in apache#13819 was missing an annotation for the "value" property. Fixes apache#16539. Line endings for ArrayOfDoublesSketchConstantPostAggregator.java are changed from \r\n to \n. Adds a serde test, and improves various other datasketches post-aggregator serde tests to deserialize into PostAggregator. This verifies that the type information is set up correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff was hard to see. Thanks for the tip.
PostAggregator andBackAgain = mapper.readValue( | ||
mapper.writeValueAsString(there), | ||
PostAggregator.class | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its stunning to see that this was not caught earlier - I wonder if exercising the serde-s in the Calcite*Test
classes might make these issues surface
...another possible way could be to ensure that annotations inside the classes are consistent - but I guess that can't be enforced for all classes as custom serializers might also be
we'll keep these in mind :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could use some approach like EqualsVerifier
. Whatever magic it does to verify equals
and hashCode
could possible be used to verify serde as well? I never looked inside it to see what it's doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, still need remove this import as it never has been used to pass the style check
...va/org/apache/druid/query/aggregation/datasketches/hll/HllSketchUnionPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
...che/druid/query/aggregation/datasketches/quantiles/DoublesSketchToCDFPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
...uid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
...ruid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilePostAggregatorTest.java
Outdated
Show resolved
Hide resolved
...uid/query/aggregation/datasketches/quantiles/DoublesSketchToQuantilesPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
...he/druid/query/aggregation/datasketches/quantiles/DoublesSketchToRankPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
.../druid/query/aggregation/datasketches/quantiles/DoublesSketchToStringPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
...ache/druid/query/aggregation/datasketches/kll/KllFloatsSketchToStringPostAggregatorTest.java
Outdated
Show resolved
Hide resolved
Fixed the excessive imports. Thanks for reviewing! |
The version originally added in #13819 was missing an annotation for the "value" property. Fixes #16539.
Line endings for ArrayOfDoublesSketchConstantPostAggregator.java are changed from
\r\n
to\n
. Try viewing with whitespace ignored to make the diff easier to read. The really meaningful change is adding a single line.Adds a serde test, and improves various other datasketches post-aggregator serde tests to deserialize into PostAggregator. This verifies that the type information is set up correctly.