-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Support for NOT NULL column constraints #22064
Support for NOT NULL column constraints #22064
Conversation
e1ad2e5
to
626e051
Compare
626e051
to
ed0f14e
Compare
a3c6f0e
to
532038d
Compare
Codenotify: Notifying subscribers in CODENOTIFY files for diff be20d29...79dc2b8.
|
532038d
to
fa07125
Compare
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.
Thanks for the docs! Looks good: a few nits, nothing else.
fa07125
to
f4ee95b
Compare
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.
Thanks for the update! Found one final nit on formatting.
f4ee95b
to
2715fdf
Compare
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.
LGTM! (docs)
Pull updated branch, new local build, no concerns. Thanks for the quick revisions!
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.
Just a few questions on the API and the grammar
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Show resolved
Hide resolved
...e-metastore/src/main/java/com/facebook/presto/hive/metastore/thrift/ThriftHiveMetastore.java
Show resolved
Hide resolved
...e-metastore/src/main/java/com/facebook/presto/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java
Outdated
Show resolved
Hide resolved
presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4
Outdated
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/tree/AlterColumnNotNull.java
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/tree/AlterColumnNotNull.java
Outdated
Show resolved
Hide resolved
2715fdf
to
f36d88c
Compare
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Outdated
Show resolved
Hide resolved
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Show resolved
Hide resolved
9255d1b
to
f29cd1d
Compare
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.
Mostly nits
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Show resolved
Hide resolved
.filter(constraint -> constraint instanceof PrimaryKeyConstraint) | ||
.collect(toList()); | ||
|
||
constraints.addAll(rawConstraints.stream() |
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.
For this method, should we just use imperative code and populate various builders? I'm wondering if we should throw an error if we encounter a constraint which is not among the subclasses of TableConstraint
(to prevent future errors).
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.
Added a validate method to TableConstraintsHolder to perform this check in one place
...e-metastore/src/main/java/com/facebook/presto/hive/metastore/thrift/ThriftHiveMetastore.java
Outdated
Show resolved
Hide resolved
...store/src/main/java/com/facebook/presto/hive/metastore/thrift/ThriftHiveMetastoreClient.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
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.
I have a concern about the alter column support. NOT NULL constraints are being treated differently (with different syntax) compared to all other constraints, but I think we should be consistent across all our constraints.
nit: noticed some of your commit titles are too long.
presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
...-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/file/FileHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/com/facebook/presto/spi/constraints/NotNullConstraint.java
Show resolved
Hide resolved
73f5696
to
0ac7b9b
Compare
presto-spi/src/main/java/com/facebook/presto/spi/constraints/TableConstraintsHolder.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
0ac7b9b
to
3d43001
Compare
presto-spi/src/main/java/com/facebook/presto/spi/constraints/TableConstraintsHolder.java
Outdated
Show resolved
Hide resolved
Supported end-to-end in the Hive connector ALTER TABLE ALTER COLUMN SET/DROP NOT NULL
3d43001
to
79dc2b8
Compare
Thanks @rschlussel. I've also pushed the final change you suggested |
Follow up to #20384
Adds support for NOT NULL column constraints in the create table statement (for the Hive connector)
Adds support for ALTER TABLE ALTER COLUMN set/drop NOT NULL
== RELEASE NOTES ==
General Changes
Hive Connector Changes