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 |
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<ColumnType> 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)
The ColumnSelectorPlus provides access to a type strategy (e.g., how to group on a float column) and a value selector for a single column.
A caller should define a strategy factory that provides an interface for type-specific operations in a query engine. See GroupByStrategyFactory for a reference.
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, TypeSignature<ValueType> type, boolean reportParseExceptions)
@Nullable public static ComparableList convertToList(Object obj, ValueType elementType)
@Nullable public static ComparableStringArray convertToComparableStringArray(Object obj)
public static int compareObjectsAsType(@Nullable Object lhs, @Nullable Object rhs, ColumnType type)
@Nullable public static Comparable<?> convertObjectToType(@Nullable Object obj, TypeSignature<ValueType> type)
public static Function<Object,Comparable<?>> converterFromTypeToType(TypeSignature<ValueType> fromType, TypeSignature<ValueType> toType)
@Nullable public static Double convertObjectToDouble(@Nullable Object valObj, boolean reportParseExceptions)
@Nullable public static Long getExactLongFromDecimalString(String decimalStr)
If the decimal value is not an exact integral value (e.g. 42.0), or if the decimal value is too large to be contained within a long, this function returns null.
decimalStr - string representing a decimal valueCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.