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

adding support for PARTITION syntax for table creation #193

Merged
merged 17 commits into from
Sep 26, 2022
Merged

Conversation

jycor
Copy link

@jycor jycor commented Sep 23, 2022

Parsing table_options for statements like CREATE TABLE (column_definitions) table_options better matches MySQL
Can parse partition_options based off of https://dev.mysql.com/doc/refman/8.0/en/create-table.html

Fix for: dolthub/dolt#4358

@jycor jycor requested a review from zachmu as a code owner September 23, 2022 17:57
@jycor jycor marked this pull request as draft September 23, 2022 17:58
@jycor jycor marked this pull request as ready for review September 23, 2022 23:03
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, nice work. Just a couple comments

}

any_keyword:
ID
Copy link
Member

Choose a reason for hiding this comment

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

ID doesn't belong here, it's not a keyword

Copy link
Author

Choose a reason for hiding this comment

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

renamed to be any_identifier instead

{
$$ = $2
$$.Options = $4
$$.Options = $4 + $5
Copy link
Member

Choose a reason for hiding this comment

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

Need a space between these?

Copy link
Author

Choose a reason for hiding this comment

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

Adding a space here makes it so that tests that don't have a partition option have a dangling space afterwards, which causes a bunch of test failures.
I could add another member variable PartitionOptions to separate the two, and make the Format() output look better.
I don't think this matters too much though, since we're not using Options anywhere outside of just testing


// partition options
{
input: "create table t (\n" +
Copy link
Member

Choose a reason for hiding this comment

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

Need some tests that combine partitions with other table options

@jycor jycor merged commit 3bf84f4 into main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants