dengzhhu653 commented on code in PR #3221:
URL: https://github.com/apache/hive/pull/3221#discussion_r912625118
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -4959,13 +4993,20 @@ public Table alterTable(String catName, String dbname,
String name, Table newTab
oldt.setOwnerType(newt.getOwnerType());
// Fully copy over the contents of the new SD into the old SD,
// so we don't create an extra SD in the metastore db that has no
references.
- MColumnDescriptor oldCD = null;
MStorageDescriptor oldSD = oldt.getSd();
+ MColumnDescriptor oldCD = null;
+ MSerDeInfo oldSerDeInfo = null;
if (oldSD != null) {
oldCD = oldSD.getCD();
+ oldSerDeInfo = oldSD.getSerDeInfo();
}
copyMSD(newt.getSd(), oldt.getSd());
- removeUnusedColumnDescriptor(oldCD);
+ if (oldSD != null && oldSD.getCD() != oldCD) {
+ removeUnusedColumnDescriptor(oldCD);
+ }
+ if (oldSD != null && oldSD.getSerDeInfo() != oldSerDeInfo) {
Review Comment:
it seems that oldSD.getSerDeInfo() always be oldSerDeInfo
--
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]