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

Alexander Alten-Lorenz commented on HIVE-3463:
----------------------------------------------

We've to decide on which table we need cascading to create the appr. schema. 
Example for SERDE (not really tested, only a design pattern)

{code}
CREATE TABLE SERDES (
    SERDE_ID VARCHAR not null,
    NAME VARCHAR not null,
    SLIB VARCHAR,
    SERDE_PARAMS STRING,
    PARAM_KEY VARCHAR not null,
    PARAM_VALUE VARCHAR not null,
    PRIMARY KEY (PARAM_KEY,PARAM_VALUE),
    KEY pkey (PARAM_KEY),
    FOREIGN KEY (PARAM_VALUE) REFERENCES SERDE_ID (id)
       ON DELETE CASCADE
       ON UPDATE CASCADE,
    FOREIGN KEY (NAME) REFERENCES SERDE_ID (id)
       ON DELETE CASCADE
       ON UPDATE CASCADE,

); 
{code}

We need to know:
- which tables and rows have to be a relationship
- what make sense to describe as a CASCADE
- are the schema we deliver good enough to implement bulk query fetching?

Thanks,
 Alex 

                
> Add CASCADING to MySQL's InnoDB schema
> --------------------------------------
>
>                 Key: HIVE-3463
>                 URL: https://issues.apache.org/jira/browse/HIVE-3463
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>    Affects Versions: 0.9.0
>            Reporter: Alexander Alten-Lorenz
>            Assignee: Alexander Alten-Lorenz
>
> Cascading could help to cleanup the tables when a FK is deleted.
> http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to