/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
@Override PrimitiveConverter getConverter(final PrimitiveType type, final int index, final ConverterParent parent, TypeInfo hiveTypeInfo) { if (hiveTypeInfo != null) { String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName()); final double minValue = getMinValue(typeName, Double.MIN_VALUE); final double maxValue = getMaxValue(typeName, Double.MAX_VALUE);
/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
@Override PrimitiveConverter getConverter(final PrimitiveType type, final int index, final ConverterParent parent, TypeInfo hiveTypeInfo) { if (hiveTypeInfo != null) { String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName()); final double minValue = getMinValue(typeName, Double.MIN_VALUE); final double maxValue = getMaxValue(typeName, Double.MAX_VALUE);
final ConverterParent parent, TypeInfo hiveTypeInfo) { if (hiveTypeInfo != null) { String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName()); final long minValue = getMinValue(type, typeName, Long.MIN_VALUE); final long maxValue = getMaxValue(typeName, Long.MAX_VALUE);
final ConverterParent parent, TypeInfo hiveTypeInfo) { if (hiveTypeInfo != null) { String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName()); final long minValue = getMinValue(type, typeName, Integer.MIN_VALUE); final long maxValue = getMaxValue(typeName, Integer.MAX_VALUE);
@Override PrimitiveConverter getConverter(final PrimitiveType type, final int index, final ConverterParent parent, TypeInfo hiveTypeInfo) { if (hiveTypeInfo != null) { String typeName = TypeInfoUtils.getBaseName(hiveTypeInfo.getTypeName()); final double minValue = getMinValue(typeName, Double.MIN_VALUE); final double maxValue = getMaxValue(typeName, Double.MAX_VALUE);
String baseName = TypeInfoUtils.getBaseName(fullName); PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);
/** * The decimal precision and scale is filled into decimalColumnVector. If the data in * Parquet is in decimal, the precision and scale will come in from decimalMetadata. If parquet * is not in decimal, then this call is made because HMS shows the type as decimal. So, the * precision and scale are picked from hiveType. * * @param decimalMetadata * @param decimalColumnVector */ private void fillDecimalPrecisionScale(DecimalMetadata decimalMetadata, DecimalColumnVector decimalColumnVector) { if (decimalMetadata != null) { decimalColumnVector.precision = (short) type.asPrimitiveType().getDecimalMetadata().getPrecision(); decimalColumnVector.scale = (short) type.asPrimitiveType().getDecimalMetadata().getScale(); } else if (TypeInfoUtils.getBaseName(hiveType.getTypeName()) .equalsIgnoreCase(serdeConstants.DECIMAL_TYPE_NAME)) { decimalColumnVector.precision = (short) ((DecimalTypeInfo) hiveType).getPrecision(); decimalColumnVector.scale = (short) ((DecimalTypeInfo) hiveType).getScale(); } else { throw new UnsupportedOperationException( "The underlying Parquet type cannot be converted to Hive Decimal type: " + type); } } }
((MapTypeInfo) hiveType).getMapValueTypeInfo() : hiveType; String typeName = TypeInfoUtils.getBaseName(realHiveType.getTypeName());
.getListElementTypeInfo() : hiveType; String typeName = TypeInfoUtils.getBaseName(realHiveType.getTypeName());
/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
String baseName = TypeInfoUtils.getBaseName(fullName); PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);
String baseName = TypeInfoUtils.getBaseName(fullName); PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);
String baseName = TypeInfoUtils.getBaseName(fullName); PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);
String baseName = TypeInfoUtils.getBaseName(fullName); PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);