aho135 commented on code in PR #19258:
URL: https://github.com/apache/druid/pull/19258#discussion_r3060226628
##########
processing/src/test/java/org/apache/druid/data/input/impl/StringDimensionSchemaTest.java:
##########
@@ -55,21 +57,121 @@ public void testDeserializeFromJson() throws
JsonProcessingException
final String json = "{\n"
+ " \"name\" : \"dim\",\n"
+ " \"multiValueHandling\" : \"SORTED_SET\",\n"
- + " \"createBitmapIndex\" : false,\n"
- + " \"maxStringLength\" : 200\n"
+ + " \"createBitmapIndex\" : false\n"
+ "}";
final StringDimensionSchema schema = (StringDimensionSchema)
jsonMapper.readValue(json, DimensionSchema.class);
Assert.assertEquals(new StringDimensionSchema("dim",
MultiValueHandling.SORTED_SET, false), schema);
- Assert.assertEquals(Integer.valueOf(200), schema.getMaxStringLength());
}
@Test
- public void testInvalidMaxStringLength()
+ public void testDeserializeFromJsonWithColumnFormatSpec() throws
JsonProcessingException
+ {
+ final String json = "{\n"
+ + " \"name\" : \"dim\",\n"
+ + " \"multiValueHandling\" : \"SORTED_SET\",\n"
+ + " \"createBitmapIndex\" : false,\n"
+ + " \"columnFormatSpec\" : { \"maxStringLength\" :
200 }\n"
+ + "}";
Review Comment:
It would be good to have a few test cases with different variations of
columnFormatSpec. For example, tests where multiValueHandling is also present
in columnFormatSpec to document the order of precedence
--
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]