[ 
https://issues.apache.org/jira/browse/HIVE-22782?focusedWorklogId=491357&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-491357
 ]

ASF GitHub Bot logged work on HIVE-22782:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Sep/20 18:45
            Start Date: 25/Sep/20 18:45
    Worklog Time Spent: 10m 
      Work Description: ashish-kumar-sharma commented on a change in pull 
request #1419:
URL: https://github.com/apache/hive/pull/1419#discussion_r495170058



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
##########
@@ -1176,145 +1166,101 @@ public void setStatsStateLikeNewTable() {
    *  Note that set apis are used by DESCRIBE only, although get apis return 
RELY or ENABLE
    *  constraints DESCRIBE could set all type of constraints
    * */
-
-  /* This only return PK which are created with RELY */
-  public PrimaryKeyInfo getPrimaryKeyInfo() {
-    if(!this.isPKFetched) {
+  public TableConstraintsInfo getTableConstraintsInfo() {
+    if (!this.isTableConstraintsFetched) {
       try {
-        pki = Hive.get().getReliablePrimaryKeys(this.getDbName(), 
this.getTableName());
-        this.isPKFetched = true;
+        tableConstraintsInfo = 
Hive.get().getTableConstraints(this.getDbName(), this.getTableName(), true, 
true);
+        this.isTableConstraintsFetched = true;
       } catch (HiveException e) {
-        LOG.warn("Cannot retrieve PK info for table : " + this.getTableName()
-            + " ignoring exception: " + e);
+        LOG.warn(

Review comment:
       If exception generated then fall back to default constructor. As all the 
constraint will set to null which was the previous contract. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 491357)
    Time Spent: 7h 10m  (was: 7h)

> Consolidate metastore call to fetch constraints
> -----------------------------------------------
>
>                 Key: HIVE-22782
>                 URL: https://issues.apache.org/jira/browse/HIVE-22782
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Planning
>            Reporter: Vineet Garg
>            Assignee: Ashish Sharma
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 7h 10m
>  Remaining Estimate: 0h
>
> Currently separate calls are made to metastore to fetch constraints like Pk, 
> fk, not null etc. Since planner always retrieve these constraints we should 
> retrieve all of them in one call.



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

Reply via email to