kgyrtkirk commented on code in PR #16550:
URL: https://github.com/apache/druid/pull/16550#discussion_r1627086505
##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchConstantPostAggregatorTest.java:
##########
@@ -66,6 +67,24 @@ public void testComparator()
Assert.assertEquals(Comparators.alwaysEqual(), postAgg.getComparator());
}
+ @Test
+ public void testSerde() throws JsonProcessingException
+ {
+ final PostAggregator there = new
ArrayOfDoublesSketchConstantPostAggregator(
+ "p",
+
"AQEJAwgBzJP/////////fwIAAAAAAAAAzT6NGdX0aWUOJvS5EIhpLwAAAAAAAAAAAAAAAAAAAAA="
+ );
+ DefaultObjectMapper mapper = new DefaultObjectMapper();
+ mapper.registerModules(new
ArrayOfDoublesSketchModule().getJacksonModules());
+ PostAggregator andBackAgain = mapper.readValue(
+ mapper.writeValueAsString(there),
+ PostAggregator.class
+ );
Review Comment:
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 :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]