protected boolean isEligibleValue(SumAgg agg, Object input) {
      if (input == null) {
        return false;
      }

      if (isWindowingDistinct()) {
        if (agg.uniqueObjects == null) {
          agg.uniqueObjects = new HashSet<ObjectInspectorObject>();
        }
        HashSet<ObjectInspectorObject> uniqueObjs = agg.uniqueObjects;
        ObjectInspectorObject obj = input instanceof ObjectInspectorObject ?
            (ObjectInspectorObject)input :
            new ObjectInspectorObject(
            ObjectInspectorUtils.copyToStandardObject(input, inputOI, ObjectInspectorCopyOption.JAVA),
            outputOI);
        if (!uniqueObjs.contains(obj)) {
          uniqueObjs.add(obj);
          return true;
        }

        return false;
      }

      return true;
    }
Check if the input object is eligible to contribute to the sum. If it's null
or the same value as the previous one for the case of SUM(DISTINCT). Then
skip it.
@param input the input object
@return True if sumDistinct is false or the non-null input is different from the previous object
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java