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

Change the definition position of the create table SelectStatement class #28808

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

zihaoAK47
Copy link
Member

@zihaoAK47 zihaoAK47 commented Oct 19, 2023

Ref #28752.

Changes proposed in this pull request:

  • Change the definition position of the create table SelectStatement class
  • mysql, oracle, sqlserver, opengauss, and postgresql all have syntax definitions for sql statements in the create table as select format

Before committing this PR, I'm sure that I have checked the following options:

  • [ ✓] My code follows the code of conduct of this project.
  • [ ✓] I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • [ ✓] I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • [ ✓] I have added corresponding unit tests for my changes.

@@ -36,7 +38,18 @@ public abstract class CreateTableStatement extends AbstractSQLStatement implemen

private SimpleTableSegment table;

private SelectStatement selectStatement;
Copy link
Member

Choose a reason for hiding this comment

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

Why move selectStatement to CreateTableStatement?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, mentor. When analyzing the SQL format of "CREATE TABLE AS SELECT" statement in MySQL, I found that Oracle, SQL Server, OpenGauss, and PostgreSQL all support similar SQL formats. The SelectStatement is currently defined in the SQLServerCreateTableStatement. Should we move the SelectStatement to the CreateTableStatement class for definition?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, commen segment should be moved to super class.

@strongduanmu strongduanmu merged commit 89ee564 into apache:master Oct 20, 2023
133 checks passed
@zihaoAK47 zihaoAK47 deleted the dev_28752 branch October 20, 2023 06:15
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.

2 participants