abhishekrb19 commented on code in PR #19198:
URL: https://github.com/apache/druid/pull/19198#discussion_r2976749390


##########
processing/src/main/java/org/apache/druid/data/input/impl/StringDimensionSchema.java:
##########
@@ -56,7 +58,7 @@ public StringDimensionSchema(
   )
   {
     super(name, multiValueHandling, createBitmapIndex == null ? 
DEFAULT_CREATE_BITMAP_INDEX : createBitmapIndex);
-    this.maxStringLength = maxStringLength != null && maxStringLength > 0 ? 
maxStringLength : getDefaultMaxStringLength();

Review Comment:
   Should this validation be 
[updated](https://github.com/jaykanakiya/druid/blob/truncation-followup/processing/src/main/java/org/apache/druid/segment/DefaultColumnFormatConfig.java#L74)
 to allow 0 values now: `if (maxStringLength != null && maxStringLength < 0) `
   



##########
processing/src/main/java/org/apache/druid/segment/StringDimensionIndexer.java:
##########
@@ -84,9 +85,12 @@ public StringDimensionIndexer(
     this.maxStringLength = maxStringLength;
   }
 
+  /**
+   * Truncates the value to {@link #maxStringLength} characters if configured, 
otherwise returns it as-is.
+   */
   private String truncateIfNeeded(String value)

Review Comment:
   ```suggestion
     @Nullable
     private String truncateIfNeeded(@Nullable String value)
   ```



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