public final class DimensionHandlerUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static ColumnCapabilities |
DEFAULT_STRING_CAPABILITIES |
static Double |
ZERO_DOUBLE |
static Float |
ZERO_FLOAT |
static Long |
ZERO_LONG |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareObjectsAsType(Object lhs,
Object rhs,
ValueType type) |
static Function<Object,Comparable<?>> |
converterFromTypeToType(ValueType fromType,
ValueType toType) |
static Double |
convertObjectToDouble(Object valObj) |
static Double |
convertObjectToDouble(Object valObj,
boolean reportParseExceptions) |
static Float |
convertObjectToFloat(Object valObj) |
static Float |
convertObjectToFloat(Object valObj,
boolean reportParseExceptions) |
static Long |
convertObjectToLong(Object valObj) |
static Long |
convertObjectToLong(Object valObj,
boolean reportParseExceptions) |
static String |
convertObjectToString(Object valObj) |
static Comparable<?> |
convertObjectToType(Object obj,
ValueType type) |
static Comparable<?> |
convertObjectToType(Object obj,
ValueType type,
boolean reportParseExceptions) |
static <Strategy extends ColumnSelectorStrategy> |
createColumnSelectorPlus(ColumnSelectorStrategyFactory<Strategy> strategyFactory,
DimensionSpec dimensionSpec,
ColumnSelectorFactory cursor)
Convenience function equivalent to calling
createColumnSelectorPluses(ColumnSelectorStrategyFactory, List, ColumnSelectorFactory) with a singleton
list of dimensionSpecs and then retrieving the only element in the returned array. |
static <Strategy extends ColumnSelectorStrategy> |
createColumnSelectorPluses(ColumnSelectorStrategyFactory<Strategy> strategyFactory,
List<DimensionSpec> dimensionSpecs,
ColumnSelectorFactory columnSelectorFactory)
Creates an array of ColumnSelectorPlus objects, selectors that handle type-specific operations within
query processing engines, using a strategy factory provided by the query engine.
|
static Long |
getExactLongFromDecimalString(String decimalStr)
Convert a string representing a decimal value to a long.
|
static DimensionHandler<?,?,?> |
getHandlerFromCapabilities(String dimensionName,
ColumnCapabilities capabilities,
DimensionSchema.MultiValueHandling multiValueHandling) |
static List<ValueType> |
getValueTypesFromDimensionSpecs(List<DimensionSpec> dimSpecs) |
static <T> T |
makeVectorProcessor(DimensionSpec dimensionSpec,
VectorColumnProcessorFactory<T> strategyFactory,
VectorColumnSelectorFactory selectorFactory)
Creates "vector processors", which are objects that wrap a single vectorized input column and provide some
functionality on top of it.
|
static <T> T |
makeVectorProcessor(String column,
VectorColumnProcessorFactory<T> strategyFactory,
VectorColumnSelectorFactory selectorFactory)
Equivalent to calling makeVectorProcessor(DefaultDimensionSpec.of(column), strategyFactory, selectorFactory).
|
static Double |
nullToZero(Double number) |
static Float |
nullToZero(Float number) |
static Long |
nullToZero(Long number) |
public static final Double ZERO_DOUBLE
public static final Float ZERO_FLOAT
public static final Long ZERO_LONG
public static final ColumnCapabilities DEFAULT_STRING_CAPABILITIES
public static DimensionHandler<?,?,?> getHandlerFromCapabilities(String dimensionName, @Nullable ColumnCapabilities capabilities, @Nullable DimensionSchema.MultiValueHandling multiValueHandling)
public static List<ValueType> getValueTypesFromDimensionSpecs(List<DimensionSpec> dimSpecs)
public static <Strategy extends ColumnSelectorStrategy> ColumnSelectorPlus<Strategy> createColumnSelectorPlus(ColumnSelectorStrategyFactory<Strategy> strategyFactory, DimensionSpec dimensionSpec, ColumnSelectorFactory cursor)
createColumnSelectorPluses(ColumnSelectorStrategyFactory, List, ColumnSelectorFactory) with a singleton
list of dimensionSpecs and then retrieving the only element in the returned array.Strategy - The strategy type created by the provided strategy factory.strategyFactory - A factory provided by query engines that generates type-handling strategiesdimensionSpec - column to generate a ColumnSelectorPlus object forcursor - Used to create value selectors for columns.which may replace this in the futurepublic static <Strategy extends ColumnSelectorStrategy> ColumnSelectorPlus<Strategy>[] createColumnSelectorPluses(ColumnSelectorStrategyFactory<Strategy> strategyFactory, List<DimensionSpec> dimensionSpecs, ColumnSelectorFactory columnSelectorFactory)
Strategy - The strategy type created by the provided strategy factory.strategyFactory - A factory provided by query engines that generates type-handling strategiesdimensionSpecs - The set of columns to generate ColumnSelectorPlus objects forcolumnSelectorFactory - Used to create value selectors for columns.which may replace this in the futurepublic static <T> T makeVectorProcessor(String column, VectorColumnProcessorFactory<T> strategyFactory, VectorColumnSelectorFactory selectorFactory)
public static <T> T makeVectorProcessor(DimensionSpec dimensionSpec, VectorColumnProcessorFactory<T> strategyFactory, VectorColumnSelectorFactory selectorFactory)
dimensionSpec - dimensionSpec for the input to the processorstrategyFactory - object that encapsulates the knowledge about how to create processorsselectorFactory - column selector factory used for creating the vector processorthe non-vectorized version@Nullable public static Long convertObjectToLong(@Nullable Object valObj, boolean reportParseExceptions)
@Nullable public static Float convertObjectToFloat(@Nullable Object valObj, boolean reportParseExceptions)
@Nullable public static Comparable<?> convertObjectToType(@Nullable Object obj, ValueType type, boolean reportParseExceptions)
public static int compareObjectsAsType(@Nullable Object lhs, @Nullable Object rhs, ValueType type)
@Nullable public static Comparable<?> convertObjectToType(@Nullable Object obj, ValueType type)
public static Function<Object,Comparable<?>> converterFromTypeToType(ValueType fromType, ValueType toType)
@Nullable public static Double convertObjectToDouble(@Nullable Object valObj, boolean reportParseExceptions)
@Nullable public static Long getExactLongFromDecimalString(String decimalStr)
decimalStr - string representing a decimal valueCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.