public abstract class FunctionalExtraction extends DimExtractionFn
ExtractionFn.ExtractionType
Constructor and Description |
---|
FunctionalExtraction(com.google.common.base.Function<String,String> extractionFunction,
boolean retainMissingValue,
String replaceMissingValueWith,
boolean injective)
The general constructor which handles most of the logic for extractions which can be expressed as a function of string-->string
|
Modifier and Type | Method and Description |
---|---|
String |
apply(String value)
The "extraction" function.
|
ExtractionFn.ExtractionType |
getExtractionType()
A dim extraction can be of one of two types, renaming or rebucketing.
|
String |
getReplaceMissingValueWith() |
boolean |
isInjective() |
boolean |
isRetainMissingValue() |
boolean |
preservesOrdering()
Offers information on whether the extraction will preserve the original ordering of the values.
|
apply, apply
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCacheKey
public FunctionalExtraction(com.google.common.base.Function<String,String> extractionFunction, boolean retainMissingValue, String replaceMissingValueWith, boolean injective)
extractionFunction
- The function to call when doing the extraction. The function must be able to accept a null input.retainMissingValue
- Boolean value on if functions which result in `null` should use the original value or should be kept as `null`replaceMissingValueWith
- String value to replace missing values with (instead of `null`)injective
- If this function always has 1:1 renames and the domain has the same cardinality of the input, this should be true and enables optimized query paths.public boolean isRetainMissingValue()
public String getReplaceMissingValueWith()
public boolean isInjective()
public String apply(String value)
ExtractionFn
Like ExtractionFn.apply(Object)
, the empty string is considered invalid output for this method and it should
instead return null.
value
- the original value of the dimensionpublic boolean preservesOrdering()
ExtractionFn
Some optimizations of queries is possible if ordering is preserved. Null values *do* count towards ordering.
public ExtractionFn.ExtractionType getExtractionType()
ExtractionFn
ExtractionFn.ExtractionType
declaring what kind of manipulation this
function doesCopyright © 2011–2017. All rights reserved.