holdenk commented on code in PR #54357: URL: https://github.com/apache/spark/pull/54357#discussion_r2842873005
########## sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/constraints/Unique.java: ########## @@ -28,6 +28,15 @@ * <p> * A UNIQUE constraint specifies one or more columns as unique columns. Such constraint is satisfied * if and only if no two rows in a table have the same non-null values in the unique columns. + * Unlike PRIMARY KEY, UNIQUE allows nullable columns. + * <p> + * NULL values are treated as distinct from each other (NULLS DISTINCT semantics). Two rows Review Comment: On the flipside if the connectors are different then querying the same data from two different backends could result in different results which might be confusing. Although I doubt the backends are going to care about our constraint spec here (although the connectors, hopefully, if they can't follow it would drop it). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
