You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by at...@apache.org on 2026/07/09 08:53:30 UTC
(iceberg) branch main updated: Revert "Core: Test geometry and geography metrics keep counts without bounds (#17131)" (#17141)
This is an automated email from the ASF dual-hosted git repository.
laskoviymishka pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 30f87adc15 Revert "Core: Test geometry and geography metrics keep counts without bounds (#17131)" (#17141)
30f87adc15 is described below
commit 30f87adc15408f798dfe3f087a6a74f0f69321ab
Author: pvary <pe...@gmail.com>
AuthorDate: Thu Jul 9 10:53:23 2026 +0200
Revert "Core: Test geometry and geography metrics keep counts without bounds (#17131)" (#17141)
This reverts commit dd35b7840edefdcbcb5a1fce14702cdafe76967b.
---
.../test/java/org/apache/iceberg/TestMetrics.java | 46 ----------------------
1 file changed, 46 deletions(-)
diff --git a/core/src/test/java/org/apache/iceberg/TestMetrics.java b/core/src/test/java/org/apache/iceberg/TestMetrics.java
index e5f4d4baff..feffc18477 100644
--- a/core/src/test/java/org/apache/iceberg/TestMetrics.java
+++ b/core/src/test/java/org/apache/iceberg/TestMetrics.java
@@ -29,7 +29,6 @@ import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
import java.nio.CharBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
@@ -258,39 +257,6 @@ public abstract class TestMetrics {
}
}
- @TestTemplate
- public void testMetricsForGeospatialTypes() throws IOException {
- // Geometry and geography are only written by the Parquet path; other formats do not support
- // the geo types yet.
- assumeThat(fileFormat()).isEqualTo(FileFormat.PARQUET);
-
- Schema schema =
- new Schema(
- required(1, "id", LongType.get()),
- optional(2, "geom", Types.GeometryType.crs84()),
- optional(3, "geog", Types.GeographyType.crs84()));
-
- Record first = GenericRecord.create(schema);
- first.setField("id", 1L);
- first.setField("geom", wkbPoint(30, 10));
- first.setField("geog", wkbPoint(-5, 40));
- Record second = GenericRecord.create(schema);
- second.setField("id", 2L);
- // both geo columns are left null
-
- Metrics metrics = getMetrics(schema, first, second);
- MetricsWithStats metricsWithStats =
- new MetricsWithStats(metrics, MetricsUtil.fromMetrics(schema, metrics));
- assertThat(metrics.recordCount()).isEqualTo(2L);
-
- // geometry and geography keep value/null counts but no bounds: lexicographic WKB min/max is not
- // meaningful, so bounds are intentionally skipped (spatial bounds are a separate follow-up).
- assertCounts(2, 2L, 1L, metricsWithStats);
- assertBounds(2, Types.GeometryType.crs84(), null, null, metricsWithStats);
- assertCounts(3, 2L, 1L, metricsWithStats);
- assertBounds(3, Types.GeographyType.crs84(), null, null, metricsWithStats);
- }
-
@TestTemplate
public void testMetricsForDecimals() throws IOException {
Schema schema =
@@ -799,18 +765,6 @@ public abstract class TestMetrics {
assertCounts(fieldId, valueCount, nullValueCount, null, metrics);
}
- private static ByteBuffer wkbPoint(double xCoord, double yCoord) {
- // little-endian WKB encoding of a point
- return ByteBuffer.wrap(
- ByteBuffer.allocate(21)
- .order(ByteOrder.LITTLE_ENDIAN)
- .put((byte) 1) // byte order: little endian
- .putInt(1) // WKB geometry type: Point
- .putDouble(xCoord)
- .putDouble(yCoord)
- .array());
- }
-
protected void assertCounts(
int fieldId, Long valueCount, Long nullValueCount, Long nanValueCount, Metrics metrics) {
assertThat(metrics.valueCounts().get(fieldId)).isEqualTo(valueCount);