gianm commented on code in PR #16550:
URL: https://github.com/apache/druid/pull/16550#discussion_r1627259662


##########
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:
   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.



-- 
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]

Reply via email to