abhishekrb19 commented on code in PR #19571:
URL: https://github.com/apache/druid/pull/19571#discussion_r3404967712
##########
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
I've added some tests in this unit test and there's some existing end-to-end
coverage in the embedded ones too for null, empty cases
Re numeric types, they're currently unsupported for the `range` shard spec
as well, given how the filters work - some details here:
https://github.com/apache/druid/pull/19415. For now it's just documented for
this new shard spec, but it would be nice to expand that functionality
generally so all shard specs benefit from it; if that's not trivial, we could
block them at creation time at least for this new shard spec in the future
--
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]