[
https://issues.apache.org/jira/browse/HIVE-22728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033666#comment-17033666
]
Miklos Gergely commented on HIVE-22728:
---------------------------------------
Ok, I've uploaded the patch, while I'm still trying to test it against
different db types, and also trying to test the upgrade.
I've modified the error message as [~kgyrtkirk] suggested though I'm not sure
if catalog should be included in it for now, as it would always look like this:
{code:java}
hive.<db_name>.<constraint_name>{code}
So as long as there is only one default catalog, I'd suggest not to include
it's name in the error message. Please let me know what you think.
> Limit the scope of uniqueness of constraint name to database
> ------------------------------------------------------------
>
> Key: HIVE-22728
> URL: https://issues.apache.org/jira/browse/HIVE-22728
> Project: Hive
> Issue Type: Wish
> Reporter: Jesus Camacho Rodriguez
> Assignee: Miklos Gergely
> Priority: Major
> Attachments: HIVE-22728.01.patch
>
>
> Currently, constraint names are globally unique across all databases
> (assumption is that this may have done by design). Nevertheless, though
> behavior seems to be implementation specific, it would be interesting to
> limit the scope to uniqueness per database.
> Currently we do not store database information with the constraints. To
> change the scope to one db, we would need to store the DB_ID in the
> KEY_CONSTRAINTS table in metastore when we create a constraint and add the
> DB_ID to the PRIMARY KEY of that table. Some minor changes to the error
> messages would be needed too, since otherwise it would be difficult to
> identify the correct violation in queries that span across multiple
> databases. Additionally, the SQL scripts will need to be updated to populate
> the DB_ID when we upgrade to new version.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)