public final class DimensionHandlerUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static ColumnCapabilities |
DEFAULT_STRING_CAPABILITIES |
static ConcurrentHashMap<String,DimensionHandlerProvider> |
DIMENSION_HANDLER_PROVIDERS |
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 Double |
nullToZero(Double number) |
static Float |
nullToZero(Float number) |
static Long |
nullToZero(Long number) |
static void |
registerDimensionHandlerProvider(String type,
DimensionHandlerProvider provider) |
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 final ConcurrentHashMap<String,DimensionHandlerProvider> DIMENSION_HANDLER_PROVIDERS
public static void registerDimensionHandlerProvider(String type, DimensionHandlerProvider provider)
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 future@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–2021 The Apache Software Foundation. All rights reserved.