Class SanitizationTransformer

  • All Implemented Interfaces:
    Serializable, RecordTransformer

    public class SanitizationTransformer
    extends Object
    implements RecordTransformer
    The SanitizationTransformer class will sanitize the values to follow certain rules including:
    • No null characters in string values
    • String values are within the length limit
    • TODO: add length limit to BYTES values if necessary

    NOTE: should put this after the DataTypeTransformer so that all values follow the data types in FieldSpec.

    See Also:
    Serialized Form
    • Constructor Detail

      • SanitizationTransformer

        public SanitizationTransformer​(Schema schema)
    • Method Detail

      • isNoOp

        public boolean isNoOp()
        Description copied from interface: RecordTransformer
        Returns true if the transformer is no-op (can be skipped), false otherwise.
        Specified by:
        isNoOp in interface RecordTransformer
      • transform

        public GenericRow transform​(GenericRow record)
        Description copied from interface: RecordTransformer
        Transforms a record based on some custom rules.
        Specified by:
        transform in interface RecordTransformer
        Parameters:
        record - Record to transform
        Returns:
        Transformed record, or null if the record does not follow certain rules.