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

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

                Author: ASF GitHub Bot
            Created on: 12/Sep/20 06:23
            Start Date: 12/Sep/20 06:23
    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_r487375367



##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
##########
@@ -1014,6 +1015,11 @@ public FileMetadataHandler 
getFileMetadataHandler(FileMetadataExprType type) {
     return null;
   }
 
+  @Override public SQLAllTableConstraints getAllTableConstraints(String 
catName, String db_name, String tbl_name)

Review comment:
       Done

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java
##########
@@ -1485,6 +1485,16 @@ void getFileMetadataByExpr(List<Long> fileIds, 
FileMetadataExprType type, byte[]
   List<SQLCheckConstraint> getCheckConstraints(String catName, String db_name,
                                                    String tbl_name) throws 
MetaException;
 
+  /**
+   *  Get all constraints of the table
+   * @param catName catalog name
+   * @param db_name database name
+   * @param tbl_name table name
+   * @return all constraints for this table
+   * @throws MetaException error accessing the RDBMS
+   */
+  SQLAllTableConstraints getAllTableConstraints(String catName, String 
db_name, String tbl_name)

Review comment:
       Done

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -2811,6 +2811,26 @@ public GetFieldsResponse 
getFieldsRequest(GetFieldsRequest req)
     return client.get_check_constraints(req).getCheckConstraints();
   }
 
+  @Override
+  public SQLAllTableConstraints 
getAllTableConstraints(AllTableConstraintsRequest req)
+      throws MetaException, NoSuchObjectException, TException {
+    long t1 = System.currentTimeMillis();
+
+    try {
+      if (!req.isSetCatName()) {
+        req.setCatName(getDefaultCatalog(conf));
+      }
+
+      return client.get_all_table_constraints(req).getAllTableConstraints();
+    } finally {
+      long diff = System.currentTimeMillis() - t1;

Review comment:
       done




----------------------------------------------------------------
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: 482430)
    Time Spent: 3h  (was: 2h 50m)

> 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: 3h
>  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