@SuppressWarnings("unchecked") private <T> T max(Statistics<?> stats, int id) { return (T) conversions.get(id).apply(stats.genericGetMax()); } }
/** * Returns the string representation of max for debugging/logging purposes. * * @return the max value as a string */ public String maxAsString() { return stringify(genericGetMax()); }
/** * Returns the string representation of max for debugging/logging purposes. * * @return the max value as a string */ public String maxAsString() { return stringify(genericGetMax()); }
/** * Compares max to the specified value in the proper way. It does the same as invoking * {@code comparator().compare(genericGetMax(), value)}. The corresponding statistics implementations overload this * method so the one with the primitive argument shall be used to avoid boxing/unboxing. * * @param value * the value which {@code max} is to be compared to * @return a negative integer, zero, or a positive integer as {@code max} is less than, equal to, or greater than * {@code value}. */ public final int compareMaxToValue(T value) { return comparator.compare(genericGetMax(), value); }
/** * Compares max to the specified value in the proper way. It does the same as invoking * {@code comparator().compare(genericGetMax(), value)}. The corresponding statistics implementations overload this * method so the one with the primitive argument shall be used to avoid boxing/unboxing. * * @param value * the value which {@code max} is to be compared to * @return a negative integer, zero, or a positive integer as {@code max} is less than, equal to, or greater than * {@code value}. */ public final int compareMaxToValue(T value) { return comparator.compare(genericGetMax(), value); }
/** * GT (>) predicate. */ private static <C extends Comparable<C>> LogicalExpression createGTPredicate( LogicalExpression left, LogicalExpression right ) { return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) -> { if (leftStat.compareMaxToValue(rightStat.genericGetMin()) <= 0) { return RowsMatch.NONE; } return leftStat.compareMinToValue(rightStat.genericGetMax()) > 0 ? checkNull(leftStat, rightStat) : RowsMatch.SOME; }); }
/** * GE (>=) predicate. */ private static <C extends Comparable<C>> LogicalExpression createGEPredicate( LogicalExpression left, LogicalExpression right ) { return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) -> { if (leftStat.compareMaxToValue(rightStat.genericGetMin()) < 0) { return RowsMatch.NONE; } return leftStat.compareMinToValue(rightStat.genericGetMax()) >= 0 ? checkNull(leftStat, rightStat) : RowsMatch.SOME; }); }
if (stats.genericGetMax() != null && stats.genericGetMin() != null && stats.genericGetMax().equals(stats.genericGetMin())) { mxValue = stats.genericGetMax(); if (containsCorruptDates == ParquetReaderUtility.DateCorruptionStatus.META_SHOWS_CORRUPTION && columnTypeMetadata.originalType == OriginalType.DATE) {
if (stats.hasNonNullValue()) { minValue = stats.genericGetMin(); maxValue = stats.genericGetMax(); if (containsCorruptDates == ParquetReaderUtility.DateCorruptionStatus.META_SHOWS_CORRUPTION && columnTypeMetadata.originalType == OriginalType.DATE) { minValue = ParquetReaderUtility.autoCorrectCorruptedDate((Integer) minValue);
/** * NE (!=) predicate. */ private static <C extends Comparable<C>> LogicalExpression createNEPredicate( LogicalExpression left, LogicalExpression right ) { return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) -> { if (leftStat.compareMaxToValue(rightStat.genericGetMin()) < 0 || rightStat.compareMaxToValue(leftStat.genericGetMin()) < 0) { return checkNull(leftStat, rightStat); } return leftStat.compareMaxToValue(rightStat.genericGetMax()) == 0 && leftStat.compareMinToValue(rightStat.genericGetMin()) == 0 ? RowsMatch.NONE : RowsMatch.SOME; }); }
Integer max = (Integer) statistics.genericGetMax(); if (statistics.hasNonNullValue()) { if (max > ParquetReaderUtility.DATE_CORRUPTION_THRESHOLD) {
fromParquetPrimitive(field.type(), stats.genericGetMin())); updateMax(upperBounds, fieldId, fromParquetPrimitive(field.type(), stats.genericGetMax()));
/** * Adds the data from the specified statistics to this builder * * @param stats * the statistics to be added */ public void add(Statistics<?> stats) { if (stats.hasNonNullValue()) { nullPages.add(false); Object min = stats.genericGetMin(); Object max = stats.genericGetMax(); addMinMax(min, max); pageIndexes.add(nextPageIndex); minMaxSize += sizeOf(min); minMaxSize += sizeOf(max); } else { nullPages.add(true); } nullCounts.add(stats.getNumNulls()); ++nextPageIndex; }
new org.apache.parquet.filter2.predicate.Statistics<T>(stats.genericGetMin(), stats.genericGetMax(), stats.comparator());
new org.apache.parquet.filter2.predicate.Statistics<T>(stats.genericGetMin(), stats.genericGetMax(), stats.comparator());
if (statistics.genericGetMin() == null || statistics.genericGetMax() == null) { return Domain.create(ValueSet.all(type), hasNullValue);
if (statistics.genericGetMin() == null || statistics.genericGetMax() == null) { return Domain.create(ValueSet.all(type), hasNullValue);