@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 oracleType = typeDefine.getDataType().toUpperCase();
        switch (oracleType) {
            case ORACLE_INTEGER:
                builder.dataType(new DecimalType(DEFAULT_PRECISION, 0));
                builder.columnLength((long) DEFAULT_PRECISION);
                break;
            case ORACLE_NUMBER:
                Long precision = typeDefine.getPrecision();
                if (precision == null || precision == 0 || precision > DEFAULT_PRECISION) {
                    precision = Long.valueOf(DEFAULT_PRECISION);
                }
                Integer scale = typeDefine.getScale();
                if (scale == null) {
                    scale = 127;
                }

                if (scale <= 0) {
                    int newPrecision = (int) (precision - scale);
                    if (newPrecision == 1) {
                        builder.dataType(BasicType.BOOLEAN_TYPE);
                    } else if (newPrecision <= 9) {
                        builder.dataType(BasicType.INT_TYPE);
                    } else if (newPrecision <= 18) {
                        builder.dataType(BasicType.LONG_TYPE);
                    } else if (newPrecision < 38) {
                        builder.dataType(new DecimalType(newPrecision, 0));
                        builder.columnLength((long) newPrecision);
                    } else {
                        builder.dataType(new DecimalType(DEFAULT_PRECISION, 0));
                        builder.columnLength((long) DEFAULT_PRECISION);
                    }
                } else if (scale <= DEFAULT_SCALE) {
                    builder.dataType(new DecimalType(precision.intValue(), scale));
                    builder.columnLength(precision);
                    builder.scale(scale);
                } else {
                    builder.dataType(new DecimalType(precision.intValue(), DEFAULT_SCALE));
                    builder.columnLength(precision);
                    builder.scale(DEFAULT_SCALE);
                }
                break;
            case ORACLE_FLOAT:
                // The float type will be converted to DecimalType(10, -127),
                // which will lose precision in the spark engine
                DecimalType floatDecimal = new DecimalType(DEFAULT_PRECISION, DEFAULT_SCALE);
                builder.dataType(floatDecimal);
                builder.columnLength((long) floatDecimal.getPrecision());
                builder.scale(floatDecimal.getScale());
                break;
            case ORACLE_BINARY_FLOAT:
            case ORACLE_REAL:
                builder.dataType(BasicType.FLOAT_TYPE);
                break;
            case ORACLE_BINARY_DOUBLE:
                builder.dataType(BasicType.DOUBLE_TYPE);
                break;
            case ORACLE_CHAR:
            case ORACLE_VARCHAR:
            case ORACLE_VARCHAR2:
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(typeDefine.getLength());
                break;
            case ORACLE_NCHAR:
            case ORACLE_NVARCHAR2:
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(
                        TypeDefineUtils.doubleByteTo4ByteLength(typeDefine.getLength()));
                break;
            case ORACLE_ROWID:
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(MAX_ROWID_LENGTH);
                break;
            case ORACLE_XML:
            case ORACLE_SYS_XML:
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(typeDefine.getLength());
                break;
            case ORACLE_LONG:
                builder.dataType(BasicType.STRING_TYPE);
                // The maximum length of the column is 2GB-1
                builder.columnLength(BYTES_2GB - 1);
                break;
            case ORACLE_CLOB:
            case ORACLE_NCLOB:
                builder.dataType(BasicType.STRING_TYPE);
                // The maximum length of the column is 4GB-1
                builder.columnLength(BYTES_4GB - 1);
                break;
            case ORACLE_BLOB:
                builder.dataType(PrimitiveByteArrayType.INSTANCE);
                // The maximum length of the column is 4GB-1
                builder.columnLength(BYTES_4GB - 1);
                break;
            case ORACLE_RAW:
                builder.dataType(PrimitiveByteArrayType.INSTANCE);
                if (typeDefine.getLength() == null || typeDefine.getLength() == 0) {
                    builder.columnLength(MAX_RAW_LENGTH);
                } else {
                    builder.columnLength(typeDefine.getLength());
                }
                break;
            case ORACLE_LONG_RAW:
                builder.dataType(PrimitiveByteArrayType.INSTANCE);
                // The maximum length of the column is 2GB-1
                builder.columnLength(BYTES_2GB - 1);
                break;
            case ORACLE_DATE:
                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);
                break;
            case ORACLE_TIMESTAMP:
            case ORACLE_TIMESTAMP_WITH_TIME_ZONE:
            case ORACLE_TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);
                if (typeDefine.getScale() == null) {
                    builder.scale(TIMESTAMP_DEFAULT_SCALE);
                } else {
                    builder.scale(typeDefine.getScale());
                }
                break;
            default:
                throw CommonError.convertToSeaTunnelTypeError(
                        DatabaseIdentifier.ORACLE, oracleType, typeDefine.getName());
        }
        return builder.build();
    }
@Test
    public void testConvertUnsupported() {
        BasicTypeDefine<Object> typeDefine =
                BasicTypeDefine.builder().name("test").columnType("aaa").dataType("aaa").build();
        try {
            OracleTypeConverter.INSTANCE.convert(typeDefine);
            Assertions.fail();
        } catch (SeaTunnelRuntimeException e) {
            // ignore
        } catch (Throwable e) {
            Assertions.fail();
        }
    }