Java Code Examples for org.apache.flink.table.types.logical.LogicalTypeRoot#DECIMAL

The following examples show how to use org.apache.flink.table.types.logical.LogicalTypeRoot#DECIMAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LegacyDecimalTypeTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public DataType transform(DataType typeToTransform) {
	LogicalType logicalType = typeToTransform.getLogicalType();
	if (logicalType instanceof LegacyTypeInformationType && logicalType.getTypeRoot() == LogicalTypeRoot.DECIMAL) {
		DataType decimalType = DataTypes
			.DECIMAL(DecimalType.MAX_PRECISION, 18)
			.bridgedTo(typeToTransform.getConversionClass());
		return logicalType.isNullable() ? decimalType : decimalType.notNull();
	}
	return typeToTransform;
}
 
Example 2
Source File: ParquetColumnarRowSplitReader.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Create readable vectors from writable vectors.
 * Especially for decimal, see {@link ParquetDecimalVector}.
 */
private ColumnVector[] createReadableVectors() {
	ColumnVector[] vectors = new ColumnVector[writableVectors.length];
	for (int i = 0; i < writableVectors.length; i++) {
		vectors[i] = selectedTypes[i].getTypeRoot() == LogicalTypeRoot.DECIMAL ?
				new ParquetDecimalVector(writableVectors[i]) :
				writableVectors[i];
	}
	return vectors;
}
 
Example 3
Source File: BinaryRow.java    From flink with Apache License 2.0 4 votes vote down vote up
public static boolean isMutable(LogicalType type) {
	return isInFixedLengthPart(type) || type.getTypeRoot() == LogicalTypeRoot.DECIMAL;
}
 
Example 4
Source File: BinaryRowData.java    From flink with Apache License 2.0 4 votes vote down vote up
public static boolean isMutable(LogicalType type) {
	return isInFixedLengthPart(type) || type.getTypeRoot() == LogicalTypeRoot.DECIMAL;
}