Class PythonTypeUtils


  • @Internal
    public final class PythonTypeUtils
    extends Object
    Utilities for converting Flink logical types, such as convert it to the related TypeSerializer or ProtoType.
    • Constructor Detail

      • PythonTypeUtils

        public PythonTypeUtils()
    • Method Detail

      • toProtoType

        public static FlinkFnApi.Schema.FieldType toProtoType​(org.apache.flink.table.types.logical.LogicalType logicalType)
      • toInternalSerializer

        public static org.apache.flink.api.common.typeutils.TypeSerializer toInternalSerializer​(org.apache.flink.table.types.logical.LogicalType logicalType)
      • toDataConverter

        public static PythonTypeUtils.DataConverter toDataConverter​(org.apache.flink.table.types.logical.LogicalType logicalType)
      • fromBigDecimal

        public static BigDecimal fromBigDecimal​(BigDecimal bigDecimal,
                                                int precision,
                                                int scale)
        Convert the specified bigDecimal according to the specified precision and scale. The specified bigDecimal may be rounded to have the specified scale and then the specified precision is checked. If precision overflow, it will return `null`.

        Note: The implementation refers to DecimalData.fromBigDecimal(java.math.BigDecimal, int, int).