@Override
    public Column convert(BasicTypeDefine typeDefine) {
        PhysicalColumn.PhysicalColumnBuilder builder =
                PhysicalColumn.builder()
                        .name(typeDefine.getName())
                        .sourceType(typeDefine.getColumnType())
                        .nullable(typeDefine.isNullable())
                        .defaultValue(typeDefine.getDefaultValue())
                        .comment(typeDefine.getComment());

        String pgDataType = typeDefine.getDataType().toLowerCase();
        switch (pgDataType) {
            case PG_BOOLEAN:
                builder.dataType(BasicType.BOOLEAN_TYPE);
                break;
            case PG_BOOLEAN_ARRAY:
                builder.dataType(ArrayType.BOOLEAN_ARRAY_TYPE);
                break;
            case PG_SMALLSERIAL:
            case PG_SMALLINT:
                builder.dataType(BasicType.SHORT_TYPE);
                break;
            case PG_SMALLINT_ARRAY:
                builder.dataType(ArrayType.SHORT_ARRAY_TYPE);
                break;
            case PG_INTEGER:
            case PG_SERIAL:
                builder.dataType(BasicType.INT_TYPE);
                break;
            case PG_INTEGER_ARRAY:
                builder.dataType(ArrayType.INT_ARRAY_TYPE);
                break;
            case PG_BIGINT:
            case PG_BIGSERIAL:
                builder.dataType(BasicType.LONG_TYPE);
                break;
            case PG_BIGINT_ARRAY:
                builder.dataType(ArrayType.LONG_ARRAY_TYPE);
                break;
            case PG_REAL:
                builder.dataType(BasicType.FLOAT_TYPE);
                break;
            case PG_REAL_ARRAY:
                builder.dataType(ArrayType.FLOAT_ARRAY_TYPE);
                break;
            case PG_DOUBLE_PRECISION:
                builder.dataType(BasicType.DOUBLE_TYPE);
                break;
            case PG_DOUBLE_PRECISION_ARRAY:
                builder.dataType(ArrayType.DOUBLE_ARRAY_TYPE);
                break;
            case PG_NUMERIC:
                DecimalType decimalType;
                if (typeDefine.getPrecision() != null && typeDefine.getPrecision() > 0) {
                    decimalType =
                            new DecimalType(
                                    typeDefine.getPrecision().intValue(), typeDefine.getScale());
                } else {
                    decimalType = new DecimalType(DEFAULT_PRECISION, DEFAULT_SCALE);
                }
                builder.dataType(decimalType);
                break;
            case PG_MONEY:
                // -92233720368547758.08 to +92233720368547758.07, With the sign bit it's 20, we use
                // 30 precision to save it
                DecimalType moneyDecimalType;
                moneyDecimalType = new DecimalType(30, 2);
                builder.dataType(moneyDecimalType);
                builder.columnLength(30L);
                builder.scale(2);
                break;
            case PG_CHAR:
            case PG_CHARACTER:
                builder.dataType(BasicType.STRING_TYPE);
                if (typeDefine.getLength() == null || typeDefine.getLength() <= 0) {
                    builder.columnLength(TypeDefineUtils.charTo4ByteLength(1L));
                    builder.sourceType(pgDataType);
                } else {
                    builder.columnLength(TypeDefineUtils.charTo4ByteLength(typeDefine.getLength()));
                    builder.sourceType(String.format("%s(%s)", pgDataType, typeDefine.getLength()));
                }
                break;
            case PG_VARCHAR:
            case PG_CHARACTER_VARYING:
                builder.dataType(BasicType.STRING_TYPE);
                if (typeDefine.getLength() == null || typeDefine.getLength() <= 0) {
                    builder.sourceType(pgDataType);
                } else {
                    builder.sourceType(String.format("%s(%s)", pgDataType, typeDefine.getLength()));
                    builder.columnLength(TypeDefineUtils.charTo4ByteLength(typeDefine.getLength()));
                }
                break;
            case PG_TEXT:
                builder.dataType(BasicType.STRING_TYPE);
                break;
            case PG_UUID:
                builder.dataType(BasicType.STRING_TYPE);
                builder.sourceType(pgDataType);
                builder.columnLength(128L);
                break;
            case PG_JSON:
            case PG_JSONB:
            case PG_XML:
            case PG_GEOMETRY:
            case PG_GEOGRAPHY:
                builder.dataType(BasicType.STRING_TYPE);
                break;
            case PG_CHAR_ARRAY:
            case PG_VARCHAR_ARRAY:
            case PG_TEXT_ARRAY:
                builder.dataType(ArrayType.STRING_ARRAY_TYPE);
                break;
            case PG_BYTEA:
                builder.dataType(PrimitiveByteArrayType.INSTANCE);
                break;
            case PG_DATE:
                builder.dataType(LocalTimeType.LOCAL_DATE_TYPE);
                break;
            case PG_TIME:
            case PG_TIME_TZ:
                builder.dataType(LocalTimeType.LOCAL_TIME_TYPE);
                if (typeDefine.getScale() != null && typeDefine.getScale() > MAX_TIME_SCALE) {
                    builder.scale(MAX_TIME_SCALE);
                    log.warn(
                            "The scale of time type is larger than {}, it will be truncated to {}",
                            MAX_TIME_SCALE,
                            MAX_TIME_SCALE);
                } else {
                    builder.scale(typeDefine.getScale());
                }
                break;
            case PG_TIMESTAMP:
            case PG_TIMESTAMP_TZ:
                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);
                if (typeDefine.getScale() != null && typeDefine.getScale() > MAX_TIMESTAMP_SCALE) {
                    builder.scale(MAX_TIMESTAMP_SCALE);
                    log.warn(
                            "The scale of timestamp type is larger than {}, it will be truncated to {}",
                            MAX_TIMESTAMP_SCALE,
                            MAX_TIMESTAMP_SCALE);
                } else {
                    builder.scale(typeDefine.getScale());
                }
                break;
            default:
                throw CommonError.convertToSeaTunnelTypeError(
                        identifier(), typeDefine.getDataType(), typeDefine.getName());
        }
        return builder.build();
    }
@Test
    public void testConvertFloat() {
        BasicTypeDefine<Object> typeDefine =
                BasicTypeDefine.builder()
                        .name("test")
                        .columnType("float4")
                        .dataType("float4")
                        .build();
        Column column = PostgresTypeConverter.INSTANCE.convert(typeDefine);
        Assertions.assertEquals(typeDefine.getName(), column.getName());
        Assertions.assertEquals(BasicType.FLOAT_TYPE, column.getDataType());
        Assertions.assertEquals(typeDefine.getColumnType(), column.getSourceType().toLowerCase());
    }