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

Add support for NOT NULL in DDL statements #418

Merged
merged 6 commits into from
Mar 12, 2019
Merged

Conversation

electrum
Copy link
Member

@electrum electrum commented Mar 9, 2019

No description provided.

@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
@electrum
Copy link
Member Author

@findepi I already reviewed this in the other repo. Let me know if you'd like to take a look, otherwise I'll merge this.

@electrum electrum force-pushed the notnull branch 2 times, most recently from c064bb8 to 6751471 Compare March 10, 2019 06:03
@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
@trinodb trinodb deleted a comment from cla-bot bot Mar 10, 2019
Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Have you changed anything other than related to rebase?

public void renameTable(JdbcIdentity identity, JdbcTableHandle handle, SchemaTableName newTableName)
{
// MySQL doesn't support specifying the catalog name in a rename. By setting the
// catalogName parameter to null, it will be omitted in the ALTER TABLE statement.
Copy link
Member

Choose a reason for hiding this comment

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

we should checkArgument(handle.getSchemaName() eq newTableName.getSchema())

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps I'm not following, but they don't have to be the same, as it's legal to rename a table across databases/schemas.

@findepi
Copy link
Member

findepi commented Mar 11, 2019

I don't like how the "Add DDL support for JDBC connectors" commit contains several changes that are not directly related.
No change requested.

@findepi
Copy link
Member

findepi commented Mar 11, 2019

@electrum i only skimmed. LGTM.

@electrum
Copy link
Member Author

Have you changed anything other than related to rebase?

@kokosing The only change was I moved testInsertIntoNotNullColumn to be MySQL and PostgreSQL specific (and thus removed the AbstractTestDistributedQueries changes) as it was making assumptions about the database-specific error message (and in the process was not testing it very well)

This requires mysql-connector-java to be updated.
- create table, add column, and drop column for everything
- rename column and rename table for MySQL and PostgreSQL

Extracted-From: https://github.com/prestodb/presto
Enable NOT NULL in the parser and add a flag in the metadata to check
whether or not a connector supports this new functionality. If a
connector doesn't support NOT NULL semantics in columns, yet this is
supplied, then a semantic exception is thrown indicating to the user
that this functionality is not supported in their catalog.

Extracted-From: https://github.com/prestodb/presto
@electrum electrum merged commit 5dda1b7 into trinodb:master Mar 12, 2019
@electrum electrum deleted the notnull branch March 12, 2019 07:14
@electrum electrum added this to the 306 milestone Mar 15, 2019
@electrum electrum mentioned this pull request Mar 15, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants