Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][connector-v2][sqlserver-cdc]Unified sqlserver TypeUtils type conversion mode #5668

Merged

Conversation

zhilinli123
Copy link
Contributor

…e conversion mode

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

…-type-transition

# Conflicts:
#	seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/utils/SqlServerTypeUtils.java
@Hisoka-X
Copy link
Member

Please add some comment.
image

@zhilinli123
Copy link
Contributor Author

image

CREATE TABLE full_types (
    id int NOT NULL,
    val_char char(3),
    val_varchar varchar(1000),
    val_text text,
    val_nchar nchar(3),
    val_nvarchar nvarchar(1000),
    val_ntext ntext,
    val_decimal decimal(6,3),
    val_numeric numeric,
    val_float float,
    val_real real,
    val_smallmoney smallmoney,
    val_money money,
    val_bit bit,
    val_tinyint tinyint,
    val_smallint smallint,
    val_int int,
    val_bigint bigint,
    val_date date,
    val_time time,
    val_datetime2 datetime2,
    val_datetime datetime,
    val_smalldatetime smalldatetime,
    val_xml xml
    PRIMARY KEY (id)
);
INSERT INTO full_types VALUES (0,
                               'cč0', 'vcč', 'tč', N'cč', N'vcč', N'tč',
                               1.123, 2, 3.323, 4.323, 5.323, 6.323,
                               1, 22, 333, 4444, 55555,
                               '2018-07-13', '10:23:45', '2018-07-13 11:23:45.34', '2018-07-13 13:23:45.78', '2018-07-13 14:23:45',
                               '<a>b</a>');

``` 1.But from the source code, the flot type is directly converted to SeaTunnel flot type, if not Debug debugging program is difficult to find this problem
2.For some **types** that are not often seen, it is impossible to satisfy, so it is necessary to find the corresponding allusions through string matching   
 Of course, this is my personal opinion, welcome the proposal

@CheneyYin
Copy link
Contributor

@zhilinli123 The datatype mapping of debezium does not completely follow SqlServer's original definition.

@CheneyYin
Copy link
Contributor

@zhilinli123 please add datetimeoffset type into test case.

@zhilinli123
Copy link
Contributor Author

@zhilinli123 please add datetimeoffset type into test case.

The dev fraction has been added. ci has checked

@Hisoka-X
Copy link
Member

cc @hailin0

@Hisoka-X Hisoka-X added this to the 2.3.4 milestone Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants