Class DimExtractionFn
- java.lang.Object
-
- org.apache.druid.query.extraction.DimExtractionFn
-
- All Implemented Interfaces:
Cacheable
,ExtractionFn
- Direct Known Subclasses:
FunctionalExtraction
,LowerExtractionFn
,MatchingDimExtractionFn
,RegexDimExtractionFn
,SearchQuerySpecDimExtractionFn
,StringFormatExtractionFn
,StrlenExtractionFn
,SubstringDimExtractionFn
,TimeDimExtractionFn
,UpperExtractionFn
public abstract class DimExtractionFn extends Object implements ExtractionFn
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.query.extraction.ExtractionFn
ExtractionFn.ExtractionType
-
-
Constructor Summary
Constructors Constructor Description DimExtractionFn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
apply(long value)
The "extraction" function.String
apply(Object value)
The "extraction" function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.java.util.common.Cacheable
getCacheKey
-
Methods inherited from interface org.apache.druid.query.extraction.ExtractionFn
apply, getExtractionType, preservesOrdering
-
-
-
-
Method Detail
-
apply
@Nullable public String apply(@Nullable Object value)
Description copied from interface:ExtractionFn
The "extraction" function. This should map an Object into some String value.In order to maintain the "null and empty string are equivalent" semantics that Druid provides, the empty string is considered invalid output for this method and should instead return null. This is a contract on the method rather than enforced at a lower level in order to eliminate a global check for extraction functions that do not already need one.
- Specified by:
apply
in interfaceExtractionFn
- Parameters:
value
- the original value of the dimension- Returns:
- a value that should be used instead of the original
-
apply
public String apply(long value)
Description copied from interface:ExtractionFn
The "extraction" function. This should map a long value into some String value.Like
ExtractionFn.apply(Object)
, the empty string is considered invalid output for this method and it should instead return null.- Specified by:
apply
in interfaceExtractionFn
- Parameters:
value
- the original value of the dimension- Returns:
- a value that should be used instead of the original
-
-