/** * Hash code for the statistics object * @return hash code int */ public int hashCode() { return 31 * Arrays.hashCode(getMaxBytes()) + 17 * Arrays.hashCode(getMinBytes()) + Long.valueOf(this.getNumNulls()).hashCode(); }
/** * Equality comparison method to compare two statistics objects. * @param stats Statistics object to compare against * @return true if objects are equal, false otherwise */ public boolean equals(Statistics stats) { return Arrays.equals(stats.getMaxBytes(), this.getMaxBytes()) && Arrays.equals(stats.getMinBytes(), this.getMinBytes()) && stats.getNumNulls() == this.getNumNulls(); }
public static Statistics toParquetStatistics(parquet.column.statistics.Statistics statistics) { Statistics stats = new Statistics(); if (!statistics.isEmpty()) { stats.setNull_count(statistics.getNumNulls()); if(statistics.hasNonNullValue()) { stats.setMax(statistics.getMaxBytes()); stats.setMin(statistics.getMinBytes()); } } return stats; }