saihemanth-cloudera commented on a change in pull request #3040:
URL: https://github.com/apache/hive/pull/3040#discussion_r818520185



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -1247,31 +1247,11 @@ public void createTable(Table tbl) throws 
AlreadyExistsException,
 
   public void createTable(Table tbl, EnvironmentContext envContext) throws 
AlreadyExistsException,
       InvalidObjectException, MetaException, NoSuchObjectException, TException 
{
-    if (!tbl.isSetCatName()) {
-      tbl.setCatName(getDefaultCatalog(conf));

Review comment:
       catalog name needs to be set if it is not set. Can you please add these 
lines back? 

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -1247,31 +1247,11 @@ public void createTable(Table tbl) throws 
AlreadyExistsException,
 
   public void createTable(Table tbl, EnvironmentContext envContext) throws 
AlreadyExistsException,
       InvalidObjectException, MetaException, NoSuchObjectException, TException 
{
-    if (!tbl.isSetCatName()) {
-      tbl.setCatName(getDefaultCatalog(conf));
-    }
-    HiveMetaHook hook = getHook(tbl);
-    if (hook != null) {
-      hook.preCreateTable(tbl);
-    }
-    boolean success = false;
-    try {
-      // Subclasses can override this step (for example, for temporary tables)
-      create_table_with_environment_context(tbl, envContext);
-      if (hook != null) {
-        hook.commitCreateTable(tbl);
-      }
-      success = true;
-    }
-    finally {
-      if (!success && (hook != null)) {
-        try {
-          hook.rollbackCreateTable(tbl);
-        } catch (Exception e){
-          LOG.error("Create rollback failed with", e);
-        }
-      }
+    CreateTableRequest request = new CreateTableRequest(tbl);
+    if (envContext != null) {
+      request.setEnvContext(envContext);
     }
+    createTable(request);

Review comment:
       Can you please add L4448-4451 to the CreateTableRequest object here 
before calling the CreateTable() api? We would need to send the processor 
capabilities (if available) to HMS.

##########
File path: 
ql/src/test/results/clientpositive/llap/enforce_constraint_notnull.q.out
##########
@@ -6411,53 +6364,16 @@ STAGE PLANS:
                     expressions: UDFToInteger(key) (type: int)
                     outputColumnNames: _col0
                     Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Filter Operator
-                      predicate: enforce_constraint(_col0 is not null) (type: 
boolean)

Review comment:
       I think this is the right behavior. Constraints on temp tables will not 
be persisted in metastore and hence the explain plan shouldn't show stats e.t.c.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to