jaykanakiya commented on code in PR #19146:
URL: https://github.com/apache/druid/pull/19146#discussion_r2961313227
##########
processing/src/test/java/org/apache/druid/segment/StringDimensionIndexerTest.java:
##########
@@ -140,6 +140,43 @@ public void testBinaryInputs()
);
}
+ @Test
+ public void testTruncation()
+ {
+ final StringDimensionIndexer indexer = new StringDimensionIndexer(
+ DimensionSchema.MultiValueHandling.SORTED_ARRAY,
+ true,
+ false,
+ 5
+ );
+
+ EncodedKeyComponent<int[]> keyComponent =
indexer.processRowValsToUnsortedEncodedKeyComponent("abcdefghij", false);
+ Assert.assertEquals(
+ "abcde",
+
indexer.convertUnsortedEncodedKeyComponentToActualList(keyComponent.getComponent())
+ );
+ }
+
+ @Test
+ public void testMultiValueNotTruncated()
+ {
+ final StringDimensionIndexer indexer = new StringDimensionIndexer(
+ DimensionSchema.MultiValueHandling.SORTED_ARRAY,
+ true,
+ false,
+ 5
+ );
+
+ EncodedKeyComponent<int[]> keyComponent =
indexer.processRowValsToUnsortedEncodedKeyComponent(
+ Arrays.asList("abcdefghij", "klmnopqrst"),
+ false
+ );
+ Assert.assertEquals(
+ Arrays.asList("abcdefghij", "klmnopqrst"),
+
indexer.convertUnsortedEncodedKeyComponentToActualList(keyComponent.getComponent())
+ );
+ }
+
private long verifyEncodedValues(
Review Comment:
I did have a chat with @abhishekrb19 about multi value strings and we
decided to leave out truncation for those.
--
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]