@Override
    public BasicTypeDefine reconvert(Column column) {
        BasicTypeDefine.BasicTypeDefineBuilder builder =
                BasicTypeDefine.builder()
                        .name(column.getName())
                        .nullable(column.isNullable())
                        .comment(column.getComment())
                        .defaultValue(column.getDefaultValue());
        switch (column.getDataType().getSqlType()) {
            case BOOLEAN:
                builder.columnType(DB2_BOOLEAN);
                builder.dataType(DB2_BOOLEAN);
                break;
            case TINYINT:
            case SMALLINT:
                builder.columnType(DB2_SMALLINT);
                builder.dataType(DB2_SMALLINT);
                break;
            case INT:
                builder.columnType(DB2_INT);
                builder.dataType(DB2_INT);
                break;
            case BIGINT:
                builder.columnType(DB2_BIGINT);
                builder.dataType(DB2_BIGINT);
                break;
            case FLOAT:
                builder.columnType(DB2_REAL);
                builder.dataType(DB2_REAL);
                break;
            case DOUBLE:
                builder.columnType(DB2_DOUBLE);
                builder.dataType(DB2_DOUBLE);
                break;
            case DECIMAL:
                DecimalType decimalType = (DecimalType) column.getDataType();
                long precision = decimalType.getPrecision();
                int scale = decimalType.getScale();
                if (precision <= 0) {
                    precision = DEFAULT_PRECISION;
                    scale = DEFAULT_SCALE;
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which is precision less than 0, "
                                    + "it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            precision,
                            scale);
                } else if (precision > MAX_PRECISION) {
                    scale = (int) Math.max(0, scale - (precision - MAX_PRECISION));
                    precision = MAX_PRECISION;
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which exceeds the maximum precision of {}, "
                                    + "it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            MAX_PRECISION,
                            precision,
                            scale);
                }
                if (scale < 0) {
                    scale = 0;
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which is scale less than 0, "
                                    + "it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            precision,
                            scale);
                } else if (scale > MAX_SCALE) {
                    scale = MAX_SCALE;
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which exceeds the maximum scale of {}, "
                                    + "it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            MAX_SCALE,
                            precision,
                            scale);
                }

                builder.columnType(String.format("%s(%s,%s)", DB2_DECIMAL, precision, scale));
                builder.dataType(DB2_DECIMAL);
                builder.precision(precision);
                builder.scale(scale);
                break;
            case BYTES:
                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {
                    builder.columnType(
                            String.format("%s(%s)", DB2_VARBINARY, MAX_VARBINARY_LENGTH));
                    builder.dataType(DB2_VARBINARY);
                    builder.length(column.getColumnLength());
                } else if (column.getColumnLength() <= MAX_BINARY_LENGTH) {
                    builder.columnType(
                            String.format("%s(%s)", DB2_BINARY, column.getColumnLength()));
                    builder.dataType(DB2_BINARY);
                    builder.length(column.getColumnLength());
                } else if (column.getColumnLength() <= MAX_VARBINARY_LENGTH) {
                    builder.columnType(
                            String.format("%s(%s)", DB2_VARBINARY, column.getColumnLength()));
                    builder.dataType(DB2_VARBINARY);
                    builder.length(column.getColumnLength());
                } else {
                    long length = column.getColumnLength();
                    if (length > MAX_BLOB_LENGTH) {
                        length = MAX_BLOB_LENGTH;
                        log.warn(
                                "The length of blob type {} is out of range, "
                                        + "it will be converted to {}({})",
                                column.getName(),
                                DB2_BLOB,
                                length);
                    }
                    builder.columnType(String.format("%s(%s)", DB2_BLOB, length));
                    builder.dataType(DB2_BLOB);
                    builder.length(length);
                }
                break;
            case STRING:
                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {
                    builder.columnType(String.format("%s(%s)", DB2_VARCHAR, MAX_VARCHAR_LENGTH));
                    builder.dataType(DB2_VARCHAR);
                    builder.length(column.getColumnLength());
                } else if (column.getColumnLength() <= MAX_CHAR_LENGTH) {
                    builder.columnType(String.format("%s(%s)", DB2_CHAR, column.getColumnLength()));
                    builder.dataType(DB2_CHAR);
                    builder.length(column.getColumnLength());
                } else if (column.getColumnLength() <= MAX_VARCHAR_LENGTH) {
                    builder.columnType(
                            String.format("%s(%s)", DB2_VARCHAR, column.getColumnLength()));
                    builder.dataType(DB2_VARCHAR);
                    builder.length(column.getColumnLength());
                } else {
                    long length = column.getColumnLength();
                    if (length > MAX_CLOB_LENGTH) {
                        length = MAX_CLOB_LENGTH;
                        log.warn(
                                "The length of clob type {} is out of range, "
                                        + "it will be converted to {}({})",
                                column.getName(),
                                DB2_CLOB,
                                length);
                    }
                    builder.columnType(String.format("%s(%s)", DB2_CLOB, length));
                    builder.dataType(DB2_CLOB);
                    builder.length(length);
                }
                break;
            case DATE:
                builder.columnType(DB2_DATE);
                builder.dataType(DB2_DATE);
                break;
            case TIME:
                builder.columnType(DB2_TIME);
                builder.dataType(DB2_TIME);
                break;
            case TIMESTAMP:
                if (column.getScale() != null && column.getScale() > 0) {
                    int timestampScale = column.getScale();
                    if (column.getScale() > MAX_TIMESTAMP_SCALE) {
                        timestampScale = MAX_TIMESTAMP_SCALE;
                        log.warn(
                                "The timestamp column {} type timestamp({}) is out of range, "
                                        + "which exceeds the maximum scale of {}, "
                                        + "it will be converted to timestamp({})",
                                column.getName(),
                                column.getScale(),
                                MAX_TIMESTAMP_SCALE,
                                timestampScale);
                    }
                    builder.columnType(String.format("%s(%s)", DB2_TIMESTAMP, timestampScale));
                    builder.scale(timestampScale);
                } else {
                    builder.columnType(DB2_TIMESTAMP);
                }
                builder.dataType(DB2_TIMESTAMP);
                break;
            default:
                throw CommonError.convertToConnectorTypeError(
                        DatabaseIdentifier.DB_2,
                        column.getDataType().getSqlType().name(),
                        column.getName());
        }
        return builder.build();
    }
@Test
    public void testReconvertDate() {
        Column column =
                PhysicalColumn.builder()
                        .name("test")
                        .dataType(LocalTimeType.LOCAL_DATE_TYPE)
                        .build();

        BasicTypeDefine typeDefine = DB2TypeConverter.INSTANCE.reconvert(column);
        Assertions.assertEquals(column.getName(), typeDefine.getName());
        Assertions.assertEquals(DB2TypeConverter.DB2_DATE, typeDefine.getColumnType());
        Assertions.assertEquals(DB2TypeConverter.DB2_DATE, typeDefine.getDataType());
    }