public class HiveDecimalUtils extends Object
Constructor and Description |
---|
HiveDecimalUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.hive.common.type.HiveDecimal |
enforcePrecisionScale(org.apache.hadoop.hive.common.type.HiveDecimal dec,
DecimalTypeInfo typeInfo) |
static org.apache.hadoop.hive.serde2.io.HiveDecimalWritable |
enforcePrecisionScale(org.apache.hadoop.hive.serde2.io.HiveDecimalWritable writable,
DecimalTypeInfo typeInfo) |
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 org.apache.hadoop.hive.common.type.HiveDecimal enforcePrecisionScale(org.apache.hadoop.hive.common.type.HiveDecimal dec, DecimalTypeInfo typeInfo)
public static org.apache.hadoop.hive.serde2.io.HiveDecimalWritable enforcePrecisionScale(org.apache.hadoop.hive.serde2.io.HiveDecimalWritable writable, DecimalTypeInfo typeInfo)
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 © 2022 The Apache Software Foundation. All rights reserved.