diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 0683440575..22cb79742c 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -284,7 +284,7 @@ protected Configuration initialValue() { static final Logger auditLog = LoggerFactory.getLogger( HiveMetaStore.class.getName() + ".audit"); - + private static void logAuditEvent(String cmd) { if (cmd == null) { return; @@ -4359,6 +4359,12 @@ private void alter_table_core(final String dbname, final String name, final Tabl if (org.apache.commons.lang.StringUtils.isNotEmpty(newLocation)) { Path tblPath = wh.getDnsPath(new Path(newLocation)); newTable.getSd().setLocation(tblPath.toString()); + // if SerdeInfo parameter `path` is used to store table path by Spark, also update it + if (newTable.getSd().getSerdeInfo().getParameters() != null) { + if (newTable.getSd().getSerdeInfo().getParameters().containsKey("path")) { + newTable.getSd().getSerdeInfo().getParameters().put("path", tblPath.toString()); + } + } } } @@ -6864,7 +6870,7 @@ public boolean set_aggr_stats_for(SetPartitionsStatsRequest request) throws TExc } newStatsMap.put(partName, csNew); } - + Map oldStatsMap = new HashMap<>(); Map mapToPart = new HashMap<>(); if (request.isSetNeedMerge() && request.isNeedMerge()) {