aho135 commented on code in PR #19571:
URL: https://github.com/apache/druid/pull/19571#discussion_r3399381484
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTuningConfigTest.java:
##########
@@ -128,6 +130,36 @@ public void testSerdeWithNonDefaults() throws Exception
Assert.assertEquals(-1, config.getMaxColumnsToMerge());
}
+ @Test
+ public void testSerdeWithStreamingPartitionsSpec() throws Exception
+ {
+ final String jsonStr = "{\n"
+ + " \"type\": \"kafka\",\n"
+ + " \"streamingPartitionsSpec\":
{\"partitionDimensions\": [\"tenant\", \"region\"]}\n"
+ + "}";
+
+ final KafkaIndexTaskTuningConfig config = (KafkaIndexTaskTuningConfig)
mapper.readValue(
+ mapper.writeValueAsString(mapper.readValue(jsonStr,
TuningConfig.class)),
+ TuningConfig.class
+ );
+
+ Assert.assertEquals(
+ new StreamingPartitionsSpec(List.of("tenant", "region")),
+ config.getStreamingPartitionsSpec()
+ );
+ Assert.assertEquals(List.of("tenant", "region"),
config.getStreamingPartitionsSpec().getPartitionDimensions());
+ }
+
Review Comment:
Might be worth having a test case which covers edge case configuration for
partitionDimensions (e.g. null values, empty string, integers)
--
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]