public class HiveDecimalUtils extends Object
Constructor and Description |
---|
HiveDecimalUtils() |
Modifier and Type | Method and Description |
---|---|
static HiveDecimal |
enforcePrecisionScale(HiveDecimal dec,
DecimalTypeInfo typeInfo) |
static HiveDecimal |
enforcePrecisionScale(HiveDecimal dec,
int maxPrecision,
int maxScale) |
static HiveDecimalWritable |
enforcePrecisionScale(HiveDecimalWritable writable,
DecimalTypeInfo typeInfo) |
static HiveDecimalWritable |
enforcePrecisionScale(HiveDecimalWritable writable,
int precision,
int scale) |
static TypeInfo |
getDecimalTypeForPrimitiveCategories(PrimitiveTypeInfo a,
PrimitiveTypeInfo b) |
static DecimalTypeInfo |
getDecimalTypeForPrimitiveCategory(PrimitiveTypeInfo a) |
static int |
getPrecisionForType(PrimitiveTypeInfo typeInfo)
Need to keep consistent with JdbcColumn.columnPrecision
|
static int |
getScaleForType(PrimitiveTypeInfo typeInfo)
Need to keep consistent with JdbcColumn.columnScale()
|
static void |
validateParameter(int precision,
int scale) |
public static HiveDecimal enforcePrecisionScale(HiveDecimal dec, DecimalTypeInfo typeInfo)
public static HiveDecimal enforcePrecisionScale(HiveDecimal dec, int maxPrecision, int maxScale)
public static HiveDecimalWritable enforcePrecisionScale(HiveDecimalWritable writable, DecimalTypeInfo typeInfo)
public static HiveDecimalWritable enforcePrecisionScale(HiveDecimalWritable writable, int precision, int scale)
public static void validateParameter(int precision, int scale)
public static int getPrecisionForType(PrimitiveTypeInfo typeInfo)
public static int getScaleForType(PrimitiveTypeInfo typeInfo)
public static TypeInfo getDecimalTypeForPrimitiveCategories(PrimitiveTypeInfo a, PrimitiveTypeInfo b)
public static DecimalTypeInfo getDecimalTypeForPrimitiveCategory(PrimitiveTypeInfo a)
Copyright © 2017 The Apache Software Foundation. All rights reserved.