tibrewalpratik17 commented on code in PR #13103:
URL: https://github.com/apache/pinot/pull/13103#discussion_r1596286765


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/SanitizationTransformer.java:
##########
@@ -38,14 +41,22 @@
  * {@link FieldSpec}.
  */
 public class SanitizationTransformer implements RecordTransformer {
+  private static final String NULL_CHARACTER = "\0";
   private final Map<String, Integer> _stringColumnMaxLengthMap = new 
HashMap<>();
+  private final boolean _failOnTrimmedStringLength;
 
-  public SanitizationTransformer(Schema schema) {
+  public SanitizationTransformer(TableConfig tableConfig, Schema schema) {
     for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {
       if (!fieldSpec.isVirtualColumn() && fieldSpec.getDataType() == 
DataType.STRING) {
         _stringColumnMaxLengthMap.put(fieldSpec.getName(), 
fieldSpec.getMaxLength());
       }
     }
+    IngestionConfig ingestionConfig = tableConfig.getIngestionConfig();
+    if (ingestionConfig != null) {
+      _failOnTrimmedStringLength = 
ingestionConfig.isFailOnTrimmedStringLength();

Review Comment:
   Yes I thought of using the same but the present default value of 
`continueOnError` is false which would make this change backward-incompatible 
as instead of trimming and moving forward; we will have to fail the transform 
function. 
   The behaviour of `continueOnError` is a bit opposite to what we need to 
maintain backward compatibility. 



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