Jackie-Jiang commented on code in PR #13103:
URL: https://github.com/apache/pinot/pull/13103#discussion_r1609080931


##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java:
##########
@@ -98,6 +98,10 @@ public abstract class FieldSpec implements 
Comparable<FieldSpec>, Serializable {
     }
   }
 
+  public enum MaxLengthExceedStrategy {
+    TRIM_LENGTH, FAIL_INGESTION, SUBSTITUTE_DEFAULT_VALUE

Review Comment:
   Let's add a strategy to do nothing when the max length is exceeded. The 
reason being currently we don't do anything for BYTES and JSON when the value 
length exceeds the max length, but in the future we also want to limit their 
length. It can also be useful when user want to turn off the max length limit.



##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java:
##########
@@ -129,11 +136,18 @@ public FieldSpec(String name, DataType dataType, boolean 
isSingleValueField, @Nu
 
   public FieldSpec(String name, DataType dataType, boolean isSingleValueField, 
int maxLength,
       @Nullable Object defaultNullValue) {
+    this(name, dataType, isSingleValueField, maxLength, defaultNullValue,
+        MaxLengthExceedStrategy.TRIM_LENGTH);

Review Comment:
   We want to have different default strategy to keep backward compatibility.
   We should use `TRIM_LENGTH` for string, and ignore max length for all other 
types



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