[jira] [Commented] (IMPALA-9158) Support loading PK/FK constraints in LocalCatalog.

2020-01-17 Thread ASF subversion and git services (Jira)


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

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

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

IMPALA-9158: Support loading primary key/foreign key constraints
in LocalCatalog Mode.

This change add a new method 'loadConstraints()' to the MetaProvider
interface.

1. In CatalogdMetaProvider implementation, we fetch the primary key
  (PK) and foreign key(FK) information via the GetPartialCatalogObject()
  RPC to the catalogd. This is modified to include PK/FK information.
  This is because, on catalog side we eagerly load PK/FK information
  which can be sent over to local catalog in a single RPC to Catalog.
  This information is then stored in TableMetaRef object for future
  consumers.
2. In the DirectMetaProvider implementation, we make two RPCs to HMS
  to directly get PK/FK information.

Load constraints can be extended to include other constraints later
(for ex: unique constraints.)

Testing:
- Added tests in LocalCatalogTest, CatalogTest and PartialCatalogInfoTest
- This change also modifies the toSqlUtil for show create table
  statements. Added a test for the same.

Change-Id: I7ea7e1bacf6eb502c67caf310a847b32687e0d58
Reviewed-on: http://gerrit.cloudera.org:8080/14731
Reviewed-by: Impala Public Jenkins 
Tested-by: Impala Public Jenkins 


> Support loading PK/FK constraints in LocalCatalog.
> --
>
> Key: IMPALA-9158
> URL: https://issues.apache.org/jira/browse/IMPALA-9158
> Project: IMPALA
>  Issue Type: Sub-task
>  Components: Frontend
>Reporter: Anurag Mantripragada
>Assignee: Anurag Mantripragada
>Priority: Critical
>
> Currently, we only added support for loading PK/FK information for Catalog 
> V1. Supporting it in LocalCatlog needs implementing loading in 
> CatalogMetaProvider and DirectMetaProvider.



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

-
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org



[jira] [Commented] (IMPALA-9158) Support loading PK/FK constraints in LocalCatalog.

2019-11-21 Thread ASF subversion and git services (Jira)


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

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

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

IMPALA-9104: Support retrieval of PK/FK information through impala-hs2-server.

The goal is to let JDBC clients get constraint information
from Impala tables. We implement two new metadata operations in
impala-hs2-server, GetPrimaryKeys and GetCrossReference, which are
already implemented in Hive's HS2. The thrift
definitions are copied from Hive's TCLIService.thrift. In FE, these
two operations are implemented to get the information from tables
in the catalog.

Much like GetColumns(), tables need to be loaded in order to be able to get
PK/FK information. We wait for the PK table/FK table to load.
In the implementation, PK/FK information is returned
ONLY if the user has access to ALL the columns involved in the PK/FK
relationship.

Testing:
- Added three test tables to our test datasets since most of our FE tests
  relied on dummy tables or testdata. It was difficult to test PK/FK with
  these methods. Also, we can build on this testdata in future when we make
  optimizer improvements.
- Added unit tests in AuthorizationTest and JDBCtest.
- Added e2e test in test_hs2.py
- This patch modifies AnalyzeDDLTests and ToSqlTests to rely on the newly
  added dataset instead of dummy tables for pk/fk tests.

Caveats:
- Ranger needs OWNER user information for authorization. Since this is HMS
  metadata that we do not aggresively load, this information is not available
  for IncompleteTables. Some foreign key tables (fact tables for example)
  might have FK/PK relationships with several PK tables some of which might
  not be loaded in catalog. Currently we have no way to check column
  previleges without owner user information tables. We do not return keys
  involving such columns. Therefore, when Ranger is used, there maybe missing
  PK/FK relationships for parent tables that are not loaded. This can be
  tracked in IMPALA-9172.
- Retrieval of constraints is not yet supported in LocalCatalog mode. See
  IMPALA-9158.

Change-Id: I8942dfbbd4a3be244eed1c61ac2ce17069960477
Reviewed-on: http://gerrit.cloudera.org:8080/14720
Reviewed-by: Vihang Karajgaonkar 
Tested-by: Impala Public Jenkins 


> Support loading PK/FK constraints in LocalCatalog.
> --
>
> Key: IMPALA-9158
> URL: https://issues.apache.org/jira/browse/IMPALA-9158
> Project: IMPALA
>  Issue Type: Sub-task
>  Components: Frontend
>Reporter: Anurag Mantripragada
>Assignee: Anurag Mantripragada
>Priority: Critical
>
> Currently, we only added support for loading PK/FK information for Catalog 
> V1. Supporting it in LocalCatlog needs implementing loading in 
> CatalogMetaProvider and DirectMetaProvider.



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

-
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org