@@ -1846,6 +1846,11 @@ public void testColumnStatistics() throws Throwable {
1846
1846
List <ColumnStatisticsObj > stats = client .getTableColumnStatistics (
1847
1847
dbName , tblName , Lists .newArrayList (colName [1 ]), ENGINE );
1848
1848
assertTrue ("stats are not empty: " + stats , stats .isEmpty ());
1849
+ // test if all columns are deleted from parameter COLUMN_STATS_ACCURATE
1850
+ Map <String , String > tableParams = client .getTable (dbName , tblName ).getParameters ();
1851
+ String table_column_stats_accurate = tableParams .get ("COLUMN_STATS_ACCURATE" );
1852
+ assertTrue ("parameter COLUMN_STATS_ACCURATE is not accurate in " + tblName , table_column_stats_accurate == null ||
1853
+ (!table_column_stats_accurate .contains (colName [0 ]) && !table_column_stats_accurate .contains (colName [1 ])));
1849
1854
1850
1855
colStats .setStatsDesc (statsDesc );
1851
1856
colStats .setStatsObj (statsObjs );
@@ -1863,6 +1868,11 @@ public void testColumnStatistics() throws Throwable {
1863
1868
// multiple columns
1864
1869
request .setCol_names (Arrays .asList (colName ));
1865
1870
assertTrue (client .deleteColumnStatistics (request ));
1871
+ // test if the columns in colName array are deleted from parameter COLUMN_STATS_ACCURATE
1872
+ tableParams = client .getTable (dbName , tblName ).getParameters ();
1873
+ table_column_stats_accurate = tableParams .get ("COLUMN_STATS_ACCURATE" );
1874
+ assertTrue ("parameter COLUMN_STATS_ACCURATE is not accurate in " + tblName , table_column_stats_accurate == null ||
1875
+ (!table_column_stats_accurate .contains (colName [0 ]) && !table_column_stats_accurate .contains (colName [1 ])));
1866
1876
colStats3 = client .getTableColumnStatistics (
1867
1877
dbName , tblName , Lists .newArrayList (colName ), ENGINE );
1868
1878
assertTrue ("stats are not empty: " + colStats3 , colStats3 .isEmpty ());
@@ -1958,6 +1968,12 @@ public void testColumnStatistics() throws Throwable {
1958
1968
Lists .newArrayList (partitions .get (0 ), partitions .get (1 ), partitions .get (2 )), Lists .newArrayList (colName ), ENGINE );
1959
1969
assertEquals (1 , stats2 .size ());
1960
1970
assertEquals (2 , stats2 .get (partitions .get (2 )).size ());
1971
+ // test if all columns are deleted from parameter COLUMN_STATS_ACCURATE
1972
+ Partition partition_0 = client .getPartition (dbName , tblName , partitions .get (0 ));
1973
+ Map <String , String > partitionParams = partition_0 .getParameters ();
1974
+ String partition_column_stats_accurate = partitionParams .get ("COLUMN_STATS_ACCURATE" );
1975
+ assertTrue ("parameter COLUMN_STATS_ACCURATE is not accurate in " + partitions .get (0 ),partition_column_stats_accurate == null ||
1976
+ (!table_column_stats_accurate .contains (colName [0 ]) && !table_column_stats_accurate .contains (colName [1 ])));
1961
1977
1962
1978
// no partition or column name is set
1963
1979
request .unsetPart_names ();
0 commit comments