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

Fix serde for ArrayOfDoublesSketchConstantPostAggregator. #16550

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

gianm
Copy link
Contributor

@gianm gianm commented Jun 5, 2024

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.

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.
Copy link
Contributor

@cryptoe cryptoe left a 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.

Comment on lines +79 to +82
PostAggregator andBackAgain = mapper.readValue(
mapper.writeValueAsString(there),
PostAggregator.class
);
Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

@asdf2014 asdf2014 left a 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

Copy link
Member

@asdf2014 asdf2014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@gianm
Copy link
Contributor Author

gianm commented Jun 5, 2024

Fixed the excessive imports. Thanks for reviewing!

@gianm gianm merged commit 2534a42 into apache:master Jun 6, 2024
54 checks passed
@gianm gianm deleted the fix-aod-sketch-const-serde branch June 6, 2024 03:01
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with PostAggregator arrayOfDoublesSketchConstant in latest Druid 29.0.1
5 participants