ramitg254 commented on code in PR #6259:
URL: https://github.com/apache/hive/pull/6259#discussion_r2719644234


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/desc/DescTableAnalyzer.java:
##########
@@ -149,30 +149,28 @@ private Map<String, String> getPartitionSpec(Hive db, 
ASTNode node, TableName ta
     if (node.getChild(1).getType() == HiveParser.TOK_PARTSPEC) {
       ASTNode partNode = (ASTNode) node.getChild(1);
 
-      Table tab = null;
+      Table table;
       try {
-        tab = db.getTable(tableName.getNotEmptyDbTable());
+        table = db.getTable(tableName.getNotEmptyDbTable());
       } catch (InvalidTableException e) {
         throw new 
SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tableName.getNotEmptyDbTable()),
 e);
       } catch (HiveException e) {
         throw new SemanticException(e.getMessage(), e);
       }
 
-      Map<String, String> partitionSpec = null;
+      Map<String, String> partitionSpec;
       try {
-        partitionSpec = getPartSpec(partNode);
-        validateUnsupportedPartitionClause(tab, partitionSpec != null && 
!partitionSpec.isEmpty());

Review Comment:
   partitionSpec gets reassigned one line later
   and this part was only required for `validateUnsupportedPartitionClause` and 
I dropped this method as we don't want to throw exception for tables which have 
non native partition support



##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/desc/DescTableAnalyzer.java:
##########
@@ -149,30 +149,28 @@ private Map<String, String> getPartitionSpec(Hive db, 
ASTNode node, TableName ta
     if (node.getChild(1).getType() == HiveParser.TOK_PARTSPEC) {
       ASTNode partNode = (ASTNode) node.getChild(1);
 
-      Table tab = null;
+      Table table;
       try {
-        tab = db.getTable(tableName.getNotEmptyDbTable());
+        table = db.getTable(tableName.getNotEmptyDbTable());
       } catch (InvalidTableException e) {
         throw new 
SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tableName.getNotEmptyDbTable()),
 e);
       } catch (HiveException e) {
         throw new SemanticException(e.getMessage(), e);
       }
 
-      Map<String, String> partitionSpec = null;
+      Map<String, String> partitionSpec;
       try {
-        partitionSpec = getPartSpec(partNode);
-        validateUnsupportedPartitionClause(tab, partitionSpec != null && 
!partitionSpec.isEmpty());

Review Comment:
   partitionSpec gets reassigned one line later
   and this part was only required for `validateUnsupportedPartitionClause` and 
I dropped this method as we don't want to throw exception for tables which have 
non native partition support anymore



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