@@ -7431,6 +7431,13 @@ public boolean delete_column_statistics_req(DeleteColumnStatisticsRequest req) t
7431
7431
if (!isPartitioned || req .isTableLevel ()) {
7432
7432
ret = rawStore .deleteTableColumnStatistics (parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tableName , colNames , engine );
7433
7433
if (ret ) {
7434
+ Map <String , String > parameters = table .getParameters ();
7435
+ if (parameters == null ) {
7436
+ parameters = new HashMap <>();
7437
+ }
7438
+ parameters .put ("COLUMN_STATS_ACCURATE" , "false" );
7439
+ table .setParameters (parameters );
7440
+ rawStore .alterTable (parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tableName , table , null );
7434
7441
eventType = EventType .DELETE_TABLE_COLUMN_STAT ;
7435
7442
for (String colName :
7436
7443
colNames == null ? table .getSd ().getCols ().stream ().map (FieldSchema ::getName ).collect (Collectors .toList ()) : colNames ) {
@@ -7460,6 +7467,14 @@ public boolean delete_column_statistics_req(DeleteColumnStatisticsRequest req) t
7460
7467
.collect (Collectors .toList ()) : colNames ) {
7461
7468
for (String partName : partNames ) {
7462
7469
List <String > partVals = getPartValsFromName (table , partName );
7470
+ Partition partition = rawStore .getPartition (parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tableName , partVals );
7471
+ Map <String , String > partParams = partition .getParameters ();
7472
+ if (partParams == null ) {
7473
+ partParams = new HashMap <>();
7474
+ }
7475
+ partParams .put ("COLUMN_STATS_ACCURATE" , "false" );
7476
+ partition .setParameters (partParams );
7477
+ rawStore .alterPartition (parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tableName , partVals , partition , null );
7463
7478
if (transactionalListeners != null && !transactionalListeners .isEmpty ()) {
7464
7479
MetaStoreListenerNotifier .notifyEvent (transactionalListeners , eventType ,
7465
7480
new DeletePartitionColumnStatEvent (parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tableName ,
0 commit comments