Skip to content

Commit

Permalink
HIVE-28578: Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
InvisibleProgrammer committed Dec 3, 2024
1 parent 7379ded commit 9df299d
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10306,30 +10306,29 @@ public Map<String, String> 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) {
Expand Down

0 comments on commit 9df299d

Please sign in to comment.