dengzhhu653 commented on code in PR #6574:
URL: https://github.com/apache/hive/pull/6574#discussion_r3526164569


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -1959,6 +1980,55 @@ private static MStorageDescriptor 
convertToMStorageDescriptor(StorageDescriptor
             .getSkewedColValueLocationMaps()), sd.isStoredAsSubDirectories());
   }
 
+  @Override
+  public MColumnDescriptor getColumnDescriptor(List<FieldSchema> cols, MTable 
mt)
+      throws MetaException {
+    if (cols == null || cols.isEmpty()) {
+      return null;
+    }
+
+    // First check to see if partition and tables column descriptor match
+    // that's the easy and relatively fast-check since does not require
+    // round-tripe to the database
+    List<FieldSchema> tableSchema = mt.getSd() != null && mt.getSd().getCD() 
!= null && mt.getSd()
+        .getCD()
+        .getCols() != null ? convertToFieldSchemas(mt.getSd()
+        .getCD()
+        .getCols()) : null;
+    if (cols.equals(tableSchema)) {
+      return mt.getSd().getCD();
+    }

Review Comment:
   Should scan through the SDS and COLUMNS_V2 only when 
`MetaStoreServerUtils.arePrefixColumns(cols, tableSchema)`, per my 
understanding, this issue should happen only when replicating the warehouse 
where partitions refer to an old table schema



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