[ 
https://issues.apache.org/jira/browse/ASTERIXDB-3317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793442#comment-17793442
 ] 

Peeyush Gupta commented on ASTERIXDB-3317:
------------------------------------------

Tabular views already allows the names of columns of the Foreign Key to be 
different from the names of columns of the Referenced Foreign Key. 
The parenthetical field name list is not required because the tabular views can 
only reference primary key which is fixed. 
The metadata query in the JDBC driver correctly returns the referenced primary 
key columns (getImportedKeys) and the foreign keys referencing a primary key 
(getExportedKeys).

> Tabular view FOREIGN KEY clause is name-deficient
> -------------------------------------------------
>
>                 Key: ASTERIXDB-3317
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3317
>             Project: Apache AsterixDB
>          Issue Type: Improvement
>          Components: COMP - Compiler, SQL - Translator SQL++
>    Affects Versions: 0.9.9
>            Reporter: Michael J. Carey
>            Assignee: Peeyush Gupta
>            Priority: Major
>              Labels: triaged
>             Fix For: 0.9.9
>
>
> Right now the FOREIGN KEY clause for tabular views is badly deficient.
> Its REFERENCES target must just be the name of a targeted tabular view.
> Like SQL, this needs to be a targeted tabular view with a parenthetical field 
> name list so that one's foreign fields can be differently named than the 
> targeted primary key fields.
> For example:
> ... FOREIGN KEY (orderno, itemno) REFERENCES items_view NOT ENFORCED
> versus
> ... FOREIGN KEY (orderno, itemno) REFERENCES items_view (ono, ino) NOT 
> ENFORCED
> The former requires name matching while the latter, like SQL, allows the 
> names to be different.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to