-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[enhancement] add param which contain column comments of source table field #3039
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
[enhancement] add param which contain column comments of source table field #3039
Conversation
|
@lvyanquan Could you please help me review this PR |
|
thanks for your implements |
|
|
||
| -- create a table which contain column comments | ||
| CREATE TABLE columnCommentsTable( | ||
| id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '自增主键', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use English because we may have foreign developers.
|
|
||
| @Experimental | ||
| public static final ConfigOption<Boolean> ENABLE_COLUMN_COMMENTS = | ||
| ConfigOptions.key("enable.column.comments") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to use "column-comments.enabled"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i fix it.
test caseCREATE TABLE IF NOT EXISTS test_flinkcdc1
(
XFID varchar(64) not null comment 'Primary key ID'
primary key,
CXYY text null,
CXSJ datetime null comment 'Cancellation time',
CREATE_TIME timestamp default CURRENT_TIMESTAMP null comment 'Creation time',
UPDATE_TIME timestamp default CURRENT_TIMESTAMP null comment 'Modification time',
CREATE_USER_ID varchar(64) null comment 'Creator ID',
CREATE_USER_NAME varchar(20) null comment 'Creator name',
CREATE_ORG_CODE varchar(64) null comment 'Creator organization code',
CREATE_ORG_NAME varchar(255) null comment 'Creator organization name',
UPDATE_USER_ID varchar(64) null comment 'Updater ID',
UPDATE_USER_NAME varchar(20) null comment 'Updater name',
UPDATE_ORG_CODE varchar(64) null comment 'Updater organization code',
UPDATE_ORG_NAME varchar(255) null comment 'Updater organization name',
DELETED varchar(2) null comment 'Deletion flag; 0-Normal, 1-Deleted'
)
comment 'Test Flink CDC 3 table' collate = utf8mb4_general_ci;
ALTER TABLE test_flinkcdc1 ADD COLUMN test11 text comment 'Test added field sync';
ALTER TABLE test_flinkcdc1 ADD COLUMN test12 text comment 'Test added field sync 2';
ALTER TABLE test_flinkcdc1 MODIFY COLUMN test12 text comment 'Test added field sync 2 modified type';
ALTER TABLE test_flinkcdc1 ADD COLUMN test13 text comment 'Test added field sync 3';
###
-- targetdb : auto-generated definition
CREATE TABLE test_flinkcdc1
(
XFID varchar(192) not null comment 'Primary key ID',
CXYY varchar(1048576) null,
CXSJ datetime null comment 'Cancellation time',
CREATE_TIME datetime null comment 'Creation time',
UPDATE_TIME datetime null comment 'Modification time',
CREATE_USER_ID varchar(192) null comment 'Creator ID',
CREATE_USER_NAME varchar(60) null comment 'Creator name',
CREATE_ORG_CODE varchar(192) null comment 'Creator organization code',
CREATE_ORG_NAME varchar(765) null comment 'Creator organization name',
UPDATE_USER_ID varchar(192) null comment 'Updater ID',
UPDATE_USER_NAME varchar(60) null comment 'Updater name',
UPDATE_ORG_CODE varchar(192) null comment 'Updater organization code',
UPDATE_ORG_NAME varchar(765) null comment 'Updater organization name',
DELETED varchar(6) null comment 'Deletion flag; 0-Normal, 1-Deleted',
test11 varchar(30) null comment 'Test added field sync',
test12 varchar(30) null comment 'Test added field sync 2',
test13 varchar(1048576) null comment 'Test added field sync 3'
)
comment 'OLAP' engine = StarRocks;
error in |
|
For starRocks db, it was observed that the comment for the table name in the target database is fixed to "OLAP." Is it possible to also synchronize the table comment from the source table? |
@everhopingandwaiting i try to fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
|
@lvyanquan @everhopingandwaiting Compilation failure is not related to the submitted code |
| "+I[2000, user_21, Shanghai, 123567891234]" | ||
| }; | ||
| // Step 2: wait the snapshot splits finished reading | ||
| Thread.sleep(5000L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only modify the necessary code, is it necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes 5 seconds cann't finish read, so i increment sleep time to 10 second.
|
Hi @dufeng1010 can you help to rebase to master? |
|
This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs. |
|
This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs. |
|
This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs. |
|
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request. |
add param which contain column comments of source table field.
fix #3007