This is an automated email from the ASF dual-hosted git repository.

gabor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new d592422  PARQUET-2072: Do Not Determine Both Min/Max for Binary Stats 
(#920)
d592422 is described below

commit d5924226007031b6aee8c94c577f9b9eaa037554
Author: belugabehr <[email protected]>
AuthorDate: Mon Aug 9 11:21:04 2021 -0400

    PARQUET-2072: Do Not Determine Both Min/Max for Binary Stats (#920)
---
 .../org/apache/parquet/column/statistics/BinaryStatistics.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/parquet-column/src/main/java/org/apache/parquet/column/statistics/BinaryStatistics.java
 
b/parquet-column/src/main/java/org/apache/parquet/column/statistics/BinaryStatistics.java
index 6cd5395..7715c07 100644
--- 
a/parquet-column/src/main/java/org/apache/parquet/column/statistics/BinaryStatistics.java
+++ 
b/parquet-column/src/main/java/org/apache/parquet/column/statistics/BinaryStatistics.java
@@ -54,9 +54,13 @@ public class BinaryStatistics extends Statistics<Binary> {
   @Override
   public void updateStats(Binary value) {
     if (!this.hasNonNullValue()) {
-      initializeStats(value, value);
-    } else {
-      updateStats(value, value);
+      min = value.copy();
+      max = value.copy();
+      this.markAsNotEmpty();
+    } else if (comparator().compare(min, value) > 0) {
+      min = value.copy();
+    } else if (comparator().compare(max, value) < 0) {
+      max = value.copy();
     }
   }
 

Reply via email to