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

ASF subversion and git services commented on IMPALA-9256:
---------------------------------------------------------

Commit d75562a7e331b7e5b2509bdc3652c557a24a04d0 in impala's branch 
refs/heads/master from Anurag Mantripragada
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=d75562a ]

IMPALA-9256: Refactor constraint information into a separate class.

This change refactors the primary keys and foreign keys into a
SqlConstraints class since they are almost always used together. This
work also helps extend the constraints class to include other
constraints we may support in the future. (Ex: Unique constraints.)

This patch also:
- Fixes a bug in the MetadataOp.getPrimaryKeys() and getForeignKeys()
  which returned incorrect results. The tests did not catch this
  before beacuse we did not have tests to verify individual resultset
  rows. The patch modifies these tests.
- Fixes a bug in foreign key constraint name generation that was
  causing foreign keys corresponding to a composite primary key get
  different foreign key constraint names instead of the same name.
- Introduces a canonical representation for foreign keys to prevent
  bugs like IMPALA-9372 which can occur due to HMS returning results
  in inconsistent ways.

Testing:
- Fixed the tests to work with the new behavior.
- Ran all the PK/FK tests.

Change-Id: I3f1c441c24df84d2d0791ffe94dff60d039a3341
Reviewed-on: http://gerrit.cloudera.org:8080/15213
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Refactor constraint information into a separate class.
> ------------------------------------------------------
>
>                 Key: IMPALA-9256
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9256
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Frontend
>            Reporter: Anurag Mantripragada
>            Assignee: Anurag Mantripragada
>            Priority: Major
>
> We recently added support for primary keys and foreign keys information for 
> tables. However, it is cleaner to have an SQLConstraint class as a container 
> for these constraints just like hive does here: 
> [https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/Constraints.java.|https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/Constraints.java]
> This can be extended to support other kinds of constraints in the future.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to