asolimando commented on code in PR #3137:
URL: https://github.com/apache/hive/pull/3137#discussion_r1041294504


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/columnstats/merge/TimestampColumnStatsMerger.java:
##########
@@ -63,6 +64,18 @@ public void merge(ColumnStatisticsObj aggregateColStats, 
ColumnStatisticsObj new
       aggregateData.setNumDVs(ndv);
     }
 
+    if (aggregateData.getHistogramEstimator() != null && 
newData.getHistogramEstimator() != null) {

Review Comment:
   The case when `aggregateData.getHistogramEstimator() == null` but 
`newData.getHistogramEstimator() != null` should set `aggregateData` to 
`newData.getHistogramEstimator()`, this was missing, so thanks for noticing!
   
   For the second case it's a no-op: if `newData.getHistogramEstimator() == 
null`, we just keep the one from the `aggregateData` (being it `null` or not).
   
   I have added a new unit-test class (`ColumnStatsMergerTest`) to test all 
these cases, which can be run as follows:
   ```
   mvn test 
-Dtest.groups=org.apache.hadoop.hive.metastore.annotation.MetastoreUnitTest 
-Dtest='ColumnStatsMergerTest.java' -pl standalone-metastore/metastore-server
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to