pgaref commented on a change in pull request #1649:
URL: https://github.com/apache/hive/pull/1649#discussion_r530261010



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFCount.java
##########
@@ -180,14 +181,13 @@ public void iterate(AggregationBuffer agg, Object[] 
parameters)
           if (((CountAgg) agg).uniqueObjects == null) {
             ((CountAgg) agg).uniqueObjects = new 
HashSet<ObjectInspectorObject>();
           }
-          HashSet<ObjectInspectorObject> uniqueObjs = ((CountAgg) 
agg).uniqueObjects;
+          Set<ObjectInspectorObject> uniqueObjs = ((CountAgg) 
agg).uniqueObjects;
 
           ObjectInspectorObject obj = new ObjectInspectorObject(
               ObjectInspectorUtils.copyToStandardObject(parameters, inputOI, 
ObjectInspectorCopyOption.JAVA),
               outputOI);
-          if (!uniqueObjs.contains(obj)) {
-            uniqueObjs.add(obj);
-          } else {
+          boolean inserted = uniqueObjs.add(obj);
+          if (!inserted){

Review comment:
       Thanks for taking care of this




----------------------------------------------------------------
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.

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