Module datarush.analytics
Class ReplaceSpecification
java.lang.Object
com.pervasive.datarush.analytics.cleansing.ReplaceSpecification
- All Implemented Interfaces:
Serializable
Specify per field or per group of fields how missing (null) values should be handled.
An action must be specified that defines how missing values are handled. A field name
can be specified or a group of fields by type. A replacement value can be given if
the action is to replace missing values with a constant value.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe action to take when a missing value is discovered within a field. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReplaceSpecificationconstant(ScalarTokenType type, String value) Create a replacement specification with theReplaceSpecification.Action.REPLACE_CONSTANTaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_CONSTANTaction for the specified field.static ReplaceSpecificationfreq(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.REPLACE_MOST_FREQaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_MOST_FREQaction for the specified field.Get the replacement action value.Get the field name.Get the field type.Get the constant replacement value.static ReplaceSpecificationmax(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.REPLACE_MAXaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_MAXaction for the specified field.static ReplaceSpecificationmean(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEANaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_MEANaction for the specified field.static ReplaceSpecificationmedian(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEDIANaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_MEDIANaction for the specified field.static ReplaceSpecificationmin(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.REPLACE_MINaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.REPLACE_MINaction for the specified field.static ReplaceSpecificationnone(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.NONEaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.NONEaction for the specified field.voidsetAction(ReplaceSpecification.Action action) Set the replacementReplaceSpecification.Action.voidsetFieldName(String fieldName) Set the field name to apply the replacement action.voidsetFieldType(ScalarTokenType fieldType) Set the field (token) type.voidsetReplacementValue(String replacementValue) Set the replacement value.static ReplaceSpecificationskip(ScalarTokenType type) Create a replacement specification with theReplaceSpecification.Action.SKIP_RECORDaction for fields with the specified type.static ReplaceSpecificationCreate a replacement specification with theReplaceSpecification.Action.SKIP_RECORDaction for the specified field.
-
Constructor Details
-
ReplaceSpecification
public ReplaceSpecification()Default public constructor.
-
-
Method Details
-
none
Create a replacement specification with theReplaceSpecification.Action.NONEaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
NONEaction
-
none
Create a replacement specification with theReplaceSpecification.Action.NONEaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
NONEaction
-
skip
Create a replacement specification with theReplaceSpecification.Action.SKIP_RECORDaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
SKIP_RECORDaction
-
skip
Create a replacement specification with theReplaceSpecification.Action.SKIP_RECORDaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
SKIP_RECORDaction
-
constant
Create a replacement specification with theReplaceSpecification.Action.REPLACE_CONSTANTaction for the specified field.- Parameters:
fieldName- apply the action to this fieldvalue- replacement value- Returns:
- specification with the
REPLACE_CONSTANTaction
-
constant
Create a replacement specification with theReplaceSpecification.Action.REPLACE_CONSTANTaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this typevalue- replacement value- Returns:
- specification with the
REPLACE_CONSTANTaction
-
min
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MINaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
REPLACE_MINaction
-
min
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MINaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
REPLACE_MINaction
-
max
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MAXaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
REPLACE_MAXaction
-
max
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MAXaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
REPLACE_MAXaction
-
median
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEDIANaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
REPLACE_MEDIANaction
-
median
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEDIANaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
REPLACE_MEDIANaction
-
mean
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEANaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
REPLACE_MEANaction
-
mean
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MEANaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
REPLACE_MEANaction
-
freq
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MOST_FREQaction for the specified field.- Parameters:
fieldName- apply the action to this field- Returns:
- specification with the
REPLACE_MOST_FREQaction
-
freq
Create a replacement specification with theReplaceSpecification.Action.REPLACE_MOST_FREQaction for fields with the specified type.- Parameters:
type- apply the action to all fields of this type- Returns:
- specification with the
REPLACE_MOST_FREQaction
-
getAction
Get the replacement action value.- Returns:
- the action
-
setAction
Set the replacementReplaceSpecification.Action.- Parameters:
action- the action to set
-
getFieldName
Get the field name.- Returns:
- the fieldName
-
setFieldName
Set the field name to apply the replacement action.- Parameters:
fieldName- the fieldName to set
-
getFieldType
Get the field type.- Returns:
- the fieldType
-
setFieldType
Set the field (token) type. All fields of this type in the input will have this missing value replacement applied to them.- Parameters:
fieldType- the fieldType to set
-
getReplacementValue
Get the constant replacement value.- Returns:
- the replacementValue
-
setReplacementValue
Set the replacement value. Only applicable if the action is set toReplaceSpecification.Action.REPLACE_CONSTANT, ignored otherwise.- Parameters:
replacementValue- the replacementValue to set
-