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

[FLINK-36178][pipeline-connector/mysql] Parse CREATE TABLE ... LIKE … syntax. #3590

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lvyanquan
Copy link
Contributor

@lvyanquan lvyanquan commented Aug 29, 2024

Support parsing SQL like following and emit new SchemaChangeEvent to downstream.

CREATE TABLE `user_log_copy` LIKE `user_log`

and

CREATE TABLE `user_log_copy` AS SELECT * FROM `user_log`

…...` syntax and create new SchemaChangeEvent for this SQL.
@lvyanquan
Copy link
Contributor Author

The test case failure in OceanBase is unrelated with this pr.

Copy link

github-actions bot commented Nov 4, 2024

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.

@github-actions github-actions bot added the Stale label Nov 4, 2024
public void exitCopyCreateTable(MySqlParser.CopyCreateTableContext ctx) {
TableId tableId = parser.parseQualifiedTableId(ctx.tableName(0).fullId());
TableId originalTableId = parser.parseQualifiedTableId(ctx.tableName(1).fullId());
Table original = parser.databaseTables().forTable(originalTableId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to consider some config options that makes the parser only parse captured table list?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to skip parsing the filtered tables.

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.

3 participants