Class CompositeTransformer
- java.lang.Object
-
- org.apache.pinot.segment.local.recordtransformer.CompositeTransformer
-
- All Implemented Interfaces:
Serializable,RecordTransformer
public class CompositeTransformer extends Object implements RecordTransformer
TheCompositeTransformerclass performs multiple transforms based on the innerRecordTransformers.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CompositeTransformer(List<RecordTransformer> transformers)
-
Method Summary
Modifier and Type Method Description static CompositeTransformergetDefaultTransformer(TableConfig tableConfig, Schema schema)Returns a record transformer that performs null value handling, time/expression/data-type transformation and record sanitization.static CompositeTransformergetPassThroughTransformer()Returns a pass through record transformer that does not transform the record.GenericRowtransform(GenericRow record)Transforms a record based on some custom rules.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.segment.local.recordtransformer.RecordTransformer
isNoOp
-
-
-
-
Constructor Detail
-
CompositeTransformer
public CompositeTransformer(List<RecordTransformer> transformers)
-
-
Method Detail
-
getDefaultTransformer
public static CompositeTransformer getDefaultTransformer(TableConfig tableConfig, Schema schema)
Returns a record transformer that performs null value handling, time/expression/data-type transformation and record sanitization.NOTE: DO NOT CHANGE THE ORDER OF THE RECORD TRANSFORMERS
-
Optional
ExpressionTransformerbefore everyone else, so that we get the real columns for other transformers to work on -
Optional
FilterTransformerafterExpressionTransformer, so that we have source as well as destination columns -
DataTypeTransformerafterFilterTransformerto convert values to comply with the schema -
Optional
TimeValidationTransformerafterDataTypeTransformerso that time value is converted to the correct type -
NullValueTransformerafterDataTypeTransformerandTimeValidationTransformerbecause empty Collection/Map/Object[] and invalid values can be replaced with null -
Optional
SanitizationTransformerafterNullValueTransformerso that before sanitation, all values are non-null and follow the data types defined in the schema
-
Optional
-
getPassThroughTransformer
public static CompositeTransformer getPassThroughTransformer()
Returns a pass through record transformer that does not transform the record.
-
transform
@Nullable public GenericRow transform(GenericRow record)
Description copied from interface:RecordTransformerTransforms a record based on some custom rules.- Specified by:
transformin interfaceRecordTransformer- Parameters:
record- Record to transform- Returns:
- Transformed record, or
nullif the record does not follow certain rules.
-
-