Skip to content

Commit ebd45a9

Browse files
committed
handle noop builder and null values
1 parent 9f0482e commit ebd45a9

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

parquet-column/src/main/java/org/apache/parquet/column/statistics/geometry/GeospatialStatistics.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,23 @@ public class GeospatialStatistics {
4848
*/
4949
private boolean valid = true;
5050

51+
/**
52+
* Merge the statistics from another GeospatialStatistics object.
53+
*
54+
* @param other the other GeospatialStatistics object
55+
*/
5156
public void mergeStatistics(GeospatialStatistics other) {
57+
if (!valid) return;
58+
5259
if (other == null) {
5360
return;
5461
}
55-
this.boundingBox.merge(other.boundingBox);
56-
this.geospatialTypes.merge(other.geospatialTypes);
62+
if (this.boundingBox != null && other.boundingBox != null) {
63+
this.boundingBox.merge(other.boundingBox);
64+
}
65+
if (this.geospatialTypes != null && other.geospatialTypes != null) {
66+
this.geospatialTypes.merge(other.geospatialTypes);
67+
}
5768
}
5869

5970
/**
@@ -247,6 +258,16 @@ public GeospatialStatistics build() {
247258
stats.valid = false; // Mark as invalid since this is a noop builder
248259
return stats;
249260
}
261+
262+
@Override
263+
public void update(Binary value) {
264+
// do nothing
265+
}
266+
267+
@Override
268+
public void abort() {
269+
// do nothing
270+
}
250271
}
251272

252273
/**

0 commit comments

Comments
 (0)