From 9df299d87a8311fde76087a0313a706c9b03ea3b Mon Sep 17 00:00:00 2001 From: InvisibleProgrammer Date: Tue, 3 Dec 2024 10:31:34 +0100 Subject: [PATCH] HIVE-28578: Address review comments --- .../hadoop/hive/metastore/ObjectStore.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 6d3eaf2f80b9..4284be9fc5c3 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -10306,30 +10306,29 @@ public Map updateTableColumnStatistics(ColumnStatistics colStats // Set the table properties // No need to check again if it exists. String dbname = table.getDbName(); - String name = table.getTableName(); - MTable oldt = mTable; + String tableName = table.getTableName(); StatsSetupConst.setColumnStatsState(newParams, colNames); - boolean isTxn = TxnUtils.isTransactionalTable(oldt.getParameters()); + boolean isTxn = TxnUtils.isTransactionalTable(mTable.getParameters()); if (isTxn) { if (!areTxnStatsSupported) { StatsSetupConst.setBasicStatsState(newParams, StatsSetupConst.FALSE); } else { - String errorMsg = verifyStatsChangeCtx(TableName.getDbTable(dbname, name), - oldt.getParameters(), newParams, writeId, validWriteIds, true); + String errorMsg = verifyStatsChangeCtx(TableName.getDbTable(dbname, tableName), + mTable.getParameters(), newParams, writeId, validWriteIds, true); if (errorMsg != null) { throw new MetaException(errorMsg); } - if (!isCurrentStatsValidForTheQuery(oldt, validWriteIds, true)) { + if (!isCurrentStatsValidForTheQuery(mTable, validWriteIds, true)) { // Make sure we set the flag to invalid regardless of the current value. StatsSetupConst.setBasicStatsState(newParams, StatsSetupConst.FALSE); LOG.info("Removed COLUMN_STATS_ACCURATE from the parameters of the table " - + dbname + "." + name); + + dbname + "." + tableName); } - oldt.setWriteId(writeId); + mTable.setWriteId(writeId); } } try { - oldt.setParameters(newParams); + mTable.setParameters(newParams); success = true; } catch (NucleusDataStoreException e) {