You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by mg...@apache.org on 2020/03/21 09:34:00 UTC

[hive] branch master updated: HIVE-23059 In constraint name uniqueness query use the MTable instead of it's id (Miklos Gergely, reviewed by Jesus Camacho Rodriguez)

This is an automated email from the ASF dual-hosted git repository.

mgergely pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 3f06375  HIVE-23059 In constraint name uniqueness query use the MTable instead of it's id (Miklos Gergely, reviewed by Jesus Camacho Rodriguez)
3f06375 is described below

commit 3f063750e98aa1fb6aafbfbdbfc1ee2066ff3d26
Author: miklosgergely <mg...@cloudera.com>
AuthorDate: Fri Mar 20 18:11:18 2020 +0100

    HIVE-23059 In constraint name uniqueness query use the MTable instead of it's id (Miklos Gergely, reviewed by Jesus Camacho Rodriguez)
---
 .../src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index 8a826d2..ffc8607 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -4605,10 +4605,10 @@ public class ObjectStore implements RawStore, Configurable {
       constraintName = normalizeIdentifier(constraintName);
       constraintExistsQuery = pm.newQuery(MConstraint.class,
           "parentTable == parentTableP && constraintName == constraintNameP");
-      constraintExistsQuery.declareParameters("java.lang.Long parentTableP, java.lang.String constraintNameP");
+      constraintExistsQuery.declareParameters("MTable parentTableP, java.lang.String constraintNameP");
       constraintExistsQuery.setUnique(true);
       constraintExistsQuery.setResult("constraintName");
-      constraintNameIfExists = (String) constraintExistsQuery.executeWithArray(table.getId(), constraintName);
+      constraintNameIfExists = (String) constraintExistsQuery.executeWithArray(table, constraintName);
       commited = commitTransaction();
     } finally {
       rollbackAndCleanup(commited, constraintExistsQuery);