@Override public boolean equals(Object o) { if (!(o instanceof DateWritable)) { return false; } return compareTo((DateWritable) o) == 0; }
@Override protected void update(Object p, PrimitiveObjectInspector inputOI) { // DateWritable is mutable, DateStatsAgg needs its own copy DateWritable v = new DateWritable((DateWritable) inputOI.getPrimitiveWritableObject(p)); //Update min counter if new value is less than min seen so far if (min == null || v.compareTo(min) < 0) { min = v; } //Update max counter if new value is greater than max seen so far if (max == null || v.compareTo(max) > 0) { max = v; } // Add value to NumDistinctValue Estimator numDV.addToEstimator(v.getDays()); }
@Override protected void updateMin(Object minValue, DateObjectInspector minFieldOI) { if ((minValue != null) && (min == null || min.compareTo(minFieldOI.getPrimitiveWritableObject(minValue)) > 0)) { // DateWritable is mutable, DateStatsAgg needs its own copy min = new DateWritable(minFieldOI.getPrimitiveWritableObject(minValue)); } }
@Override protected void updateMax(Object maxValue, DateObjectInspector maxFieldOI) { if ((maxValue != null) && (max == null || max.compareTo(maxFieldOI.getPrimitiveWritableObject(maxValue)) < 0)) { // DateWritable is mutable, DateStatsAgg needs its own copy max = new DateWritable(maxFieldOI.getPrimitiveWritableObject(maxValue)); } } };
@Override public boolean equals(Object o) { if (!(o instanceof DateWritable)) { return false; } return compareTo((DateWritable) o) == 0; }
@Override public boolean equals(Object o) { if (!(o instanceof DateWritable)) { return false; } return compareTo((DateWritable) o) == 0; }
@Override public boolean equals(Object o) { if (!(o instanceof DateWritable)) { return false; } return compareTo((DateWritable) o) == 0; }
@Override public boolean equals(Object o) { if (!(o instanceof DateWritable)) { return false; } return compareTo((DateWritable) o) == 0; }
@Override protected void update(Object p, PrimitiveObjectInspector inputOI) { // DateWritable is mutable, DateStatsAgg needs its own copy DateWritable v = new DateWritable((DateWritable) inputOI.getPrimitiveWritableObject(p)); //Update min counter if new value is less than min seen so far if (min == null || v.compareTo(min) < 0) { min = v; } //Update max counter if new value is greater than max seen so far if (max == null || v.compareTo(max) > 0) { max = v; } // Add value to NumDistinctValue Estimator numDV.addToEstimator(v.getDays()); }
@Override protected void updateMax(Object maxValue, DateObjectInspector maxFieldOI) { if ((maxValue != null) && (max == null || max.compareTo(maxFieldOI.getPrimitiveWritableObject(maxValue)) < 0)) { // DateWritable is mutable, DateStatsAgg needs its own copy max = new DateWritable(maxFieldOI.getPrimitiveWritableObject(maxValue)); } } };
@Override protected void updateMin(Object minValue, DateObjectInspector minFieldOI) { if ((minValue != null) && (min == null || min.compareTo(minFieldOI.getPrimitiveWritableObject(minValue)) > 0)) { // DateWritable is mutable, DateStatsAgg needs its own copy min = new DateWritable(minFieldOI.getPrimitiveWritableObject(minValue)); } }
DateWritable d2 = ((DateObjectInspector) poi2) .getPrimitiveWritableObject(o2); return d1.compareTo(d2);
DateWritable d2 = ((DateObjectInspector) poi2) .getPrimitiveWritableObject(o2); return d1.compareTo(d2);
DateWritable d2 = ((DateObjectInspector) poi2) .getPrimitiveWritableObject(o2); return d1.compareTo(d2);