You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "wirybeaver (via GitHub)" <gi...@apache.org> on 2026/10/04 19:55:06 UTC
[PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
wirybeaver opened a new pull request, #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342
## Summary
Part 3 of the geospatial support stack. Depends on #3341 and #2933.
- Writes Arrow WKB extension fields as Parquet geometry/geography logical types.
- Preserves CRS and geography edge-interpolation metadata.
- Omits optional scalar lower/upper bounds until geospatial zonemap statistics are implemented.
- Adds an end-to-end Iceberg writer/reader round trip that verifies WKB payloads and Parquet logical metadata.
For the review-only delta over part 2: https://github.com/wirybeaver/iceberg-rust/compare/support-geometry-geography-read...support-geometry-geography-write
## Tests
- `cargo check -p iceberg --locked`
- `cargo test -p iceberg geospatial`
- `cargo test -p iceberg avro_bytes_geometry`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066927
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -364,13 +443,22 @@ impl MinMaxColAggregator {
// Ignore the field if it is not in schema.
return Ok(());
};
- let Type::Primitive(ty) = ty.clone() else {
+ let Type::Primitive(ty) = ty else {
return Err(Error::new(
ErrorKind::Unexpected,
format!("Composed type {ty} is not supported for min max aggregation."),
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
Review Comment:
Agreed on keeping the scope to Geometry. after fix,
- only Geometry consumes Parquet bounding boxes
- Geography returns without producing lower/upper bounds, even when its column metadata includes geo_statistics.
- Removed the geography union/normalization path and added a regression test for that omission.
- Geography payload and logical metadata writing remain covered by the Parquet round-trip test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066927
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -364,13 +443,22 @@ impl MinMaxColAggregator {
// Ignore the field if it is not in schema.
return Ok(());
};
- let Type::Primitive(ty) = ty.clone() else {
+ let Type::Primitive(ty) = ty else {
return Err(Error::new(
ErrorKind::Unexpected,
format!("Composed type {ty} is not supported for min max aggregation."),
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
Review Comment:
check the comment by @paleolimbot: https://github.com/apache/iceberg-rust/pull/3342#issuecomment-6619176801
We can handle the bounded case for geography
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066927
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -364,13 +443,22 @@ impl MinMaxColAggregator {
// Ignore the field if it is not in schema.
return Ok(());
};
- let Type::Primitive(ty) = ty.clone() else {
+ let Type::Primitive(ty) = ty else {
return Err(Error::new(
ErrorKind::Unexpected,
format!("Composed type {ty} is not supported for min max aggregation."),
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
Review Comment:
check the comment by @paleolimbot: https://github.com/apache/iceberg-rust/pull/3342#issuecomment-6619176801
We can handle the supplied geography bound
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066136
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -401,8 +489,48 @@ impl MinMaxColAggregator {
Ok(())
}
+ fn update_geo(&mut self, field_id: i32, column: &ColumnChunkMetaData) {
+ // Null-only row groups do not contribute coordinates and need no bounding box.
+ if column.num_values() == 0
+ || column
+ .statistics()
+ .and_then(Statistics::null_count_opt)
+ .is_some_and(|nulls| nulls == column.num_values() as u64)
+ {
+ return;
+ }
+ let bbox = column
+ .geo_statistics()
+ .and_then(|stats| stats.bounding_box());
+ self.geo_bounds
+ .entry(field_id)
+ .and_modify(|state| {
+ if let (Some(bounds), Some(bbox)) = (state.as_mut(), bbox) {
+ bounds.merge(bbox);
+ } else {
+ *state = None;
+ }
+ })
+ .or_insert_with(|| bbox.map(GeospatialBounds::from));
+ }
+
/// Returns lower and upper bounds
- fn produce(self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ fn produce(mut self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ for (field_id, bounds) in self.geo_bounds {
+ if let Some(bounds) = bounds {
+ let ty = self
+ .schema
+ .field_by_id(field_id)
+ .unwrap()
+ .field_type
+ .as_primitive_type()
+ .unwrap()
+ .clone();
+ let (lower, upper) = bounds.into_datums(ty);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066136
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -401,8 +489,48 @@ impl MinMaxColAggregator {
Ok(())
}
+ fn update_geo(&mut self, field_id: i32, column: &ColumnChunkMetaData) {
+ // Null-only row groups do not contribute coordinates and need no bounding box.
+ if column.num_values() == 0
+ || column
+ .statistics()
+ .and_then(Statistics::null_count_opt)
+ .is_some_and(|nulls| nulls == column.num_values() as u64)
+ {
+ return;
+ }
+ let bbox = column
+ .geo_statistics()
+ .and_then(|stats| stats.bounding_box());
+ self.geo_bounds
+ .entry(field_id)
+ .and_modify(|state| {
+ if let (Some(bounds), Some(bbox)) = (state.as_mut(), bbox) {
+ bounds.merge(bbox);
+ } else {
+ *state = None;
+ }
+ })
+ .or_insert_with(|| bbox.map(GeospatialBounds::from));
+ }
+
/// Returns lower and upper bounds
- fn produce(self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ fn produce(mut self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ for (field_id, bounds) in self.geo_bounds {
+ if let Some(bounds) = bounds {
+ let ty = self
+ .schema
+ .field_by_id(field_id)
+ .unwrap()
+ .field_type
+ .as_primitive_type()
+ .unwrap()
+ .clone();
+ let (lower, upper) = bounds.into_datums(ty);
Review Comment:
Each geometry bounds entry now carries its PrimitiveType with the accumulated bounds. produce() uses that stored type directly; it no longer looks the field up in the schema again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "CTTY (via GitHub) via issues" <is...@iceberg.apache.org>.
CTTY commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4460766129
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -2570,11 +2703,252 @@ mod tests {
(
parquet::basic::Type::FIXED_LEN_BYTE_ARRAY,
16,
- Some(&parquet::basic::LogicalType::Uuid)
+ Some(&LogicalType::Uuid)
)
);
}
+ #[tokio::test]
+ async fn test_geospatial_write_roundtrip() -> Result<()> {
Review Comment:
Can we break this down into multiple tests? currently it's kinda hard to read and understand what exact case do we cover here
Also I noticed some cases are not really covered. I asked my agent to come up with more testing cases:
- Check plain XY and XYZ bounds
- Wrapping geometry box turns into +inf/-inf
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -401,8 +489,48 @@ impl MinMaxColAggregator {
Ok(())
}
+ fn update_geo(&mut self, field_id: i32, column: &ColumnChunkMetaData) {
+ // Null-only row groups do not contribute coordinates and need no bounding box.
+ if column.num_values() == 0
+ || column
+ .statistics()
+ .and_then(Statistics::null_count_opt)
+ .is_some_and(|nulls| nulls == column.num_values() as u64)
+ {
+ return;
+ }
+ let bbox = column
+ .geo_statistics()
+ .and_then(|stats| stats.bounding_box());
+ self.geo_bounds
+ .entry(field_id)
+ .and_modify(|state| {
+ if let (Some(bounds), Some(bbox)) = (state.as_mut(), bbox) {
+ bounds.merge(bbox);
+ } else {
+ *state = None;
+ }
+ })
+ .or_insert_with(|| bbox.map(GeospatialBounds::from));
+ }
+
/// Returns lower and upper bounds
- fn produce(self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ fn produce(mut self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ for (field_id, bounds) in self.geo_bounds {
+ if let Some(bounds) = bounds {
+ let ty = self
+ .schema
+ .field_by_id(field_id)
+ .unwrap()
+ .field_type
+ .as_primitive_type()
+ .unwrap()
+ .clone();
+ let (lower, upper) = bounds.into_datums(ty);
Review Comment:
It feels off that we have to find the ty again, can we carry the type along with the geo_bound state?
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -364,13 +443,22 @@ impl MinMaxColAggregator {
// Ignore the field if it is not in schema.
return Ok(());
};
- let Type::Primitive(ty) = ty.clone() else {
+ let Type::Primitive(ty) = ty else {
return Err(Error::new(
ErrorKind::Unexpected,
format!("Composed type {ty} is not supported for min max aggregation."),
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
Review Comment:
I have some concerns about handling geography data here. After some investigation, it looks like on the Java side people have already discussed the same before and the result is: We cannot trust any geography vertexes to use them to draw bounding boxes for geography data because they may not include the edges: https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/GeometryBoundsBuilder.java#L39-L42
I think it would be safer to only update_geo for Geometry data, and leave geography unhandled for now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066136
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -401,8 +489,48 @@ impl MinMaxColAggregator {
Ok(())
}
+ fn update_geo(&mut self, field_id: i32, column: &ColumnChunkMetaData) {
+ // Null-only row groups do not contribute coordinates and need no bounding box.
+ if column.num_values() == 0
+ || column
+ .statistics()
+ .and_then(Statistics::null_count_opt)
+ .is_some_and(|nulls| nulls == column.num_values() as u64)
+ {
+ return;
+ }
+ let bbox = column
+ .geo_statistics()
+ .and_then(|stats| stats.bounding_box());
+ self.geo_bounds
+ .entry(field_id)
+ .and_modify(|state| {
+ if let (Some(bounds), Some(bbox)) = (state.as_mut(), bbox) {
+ bounds.merge(bbox);
+ } else {
+ *state = None;
+ }
+ })
+ .or_insert_with(|| bbox.map(GeospatialBounds::from));
+ }
+
/// Returns lower and upper bounds
- fn produce(self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ fn produce(mut self) -> (HashMap<i32, Datum>, HashMap<i32, Datum>) {
+ for (field_id, bounds) in self.geo_bounds {
+ if let Some(bounds) = bounds {
+ let ty = self
+ .schema
+ .field_by_id(field_id)
+ .unwrap()
+ .field_type
+ .as_primitive_type()
+ .unwrap()
+ .clone();
+ let (lower, upper) = bounds.into_datums(ty);
Review Comment:
Addressed in 88ce4168. Each geometry bounds entry now carries its PrimitiveType with the accumulated bounds. produce() uses that stored type directly; it no longer looks the field up in the schema again.
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -2570,11 +2703,252 @@ mod tests {
(
parquet::basic::Type::FIXED_LEN_BYTE_ARRAY,
16,
- Some(&parquet::basic::LogicalType::Uuid)
+ Some(&LogicalType::Uuid)
)
);
}
+ #[tokio::test]
+ async fn test_geospatial_write_roundtrip() -> Result<()> {
Review Comment:
Addressed in 88ce4168. Split the long lifecycle test into named Parquet payload/metadata round-trip, manifest bounds round-trip, and scalar-metrics safety tests, sharing one file fixture. Added focused XY, XYZ, and wrapping-geometry serialization tests; the wrapping case checks negative/positive infinity for X. Missing statistics and null-only row groups have separate, small aggregation scenarios.
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -364,13 +443,22 @@ impl MinMaxColAggregator {
// Ignore the field if it is not in schema.
return Ok(());
};
- let Type::Primitive(ty) = ty.clone() else {
+ let Type::Primitive(ty) = ty else {
return Err(Error::new(
ErrorKind::Unexpected,
format!("Composed type {ty} is not supported for min max aggregation."),
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
Review Comment:
Agreed on keeping the scope to Geometry. In 88ce4168, only Geometry consumes Parquet bounding boxes; Geography returns without producing lower/upper bounds, even when its column metadata includes geo_statistics. Removed the geography union/normalization path and added a regression test for that omission. Geography payload and logical metadata writing remain covered by the Parquet round-trip test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066525
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -2570,11 +2703,252 @@ mod tests {
(
parquet::basic::Type::FIXED_LEN_BYTE_ARRAY,
16,
- Some(&parquet::basic::LogicalType::Uuid)
+ Some(&LogicalType::Uuid)
)
);
}
+ #[tokio::test]
+ async fn test_geospatial_write_roundtrip() -> Result<()> {
Review Comment:
Split the long lifecycle test into named Parquet payload/metadata round-trip, manifest bounds round-trip, and scalar-metrics safety tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "paleolimbot (via GitHub) via issues" <is...@iceberg.apache.org>.
paleolimbot commented on PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#issuecomment-6619176801
> I have some concerns about handling geography data here.
I believe the previous version of this PR was correct: bounding boxes written to Parquet files MUST have included all coordinates (i.e., the bounds written to Parquet must have already included the curvature of the edges). This is part of the Parquet spec...if files were written by a Parquet writer in this way it is an error of the Parquet writer and not iceberg.
(This is only a bummer because if we don't include this I can't eliminate my iceberg-rust fork 🙁 )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#issuecomment-6621274931
@CTTY @paleolimbot Thanks for clarifying the distinction between computing bounds and propagating existing statistics.
I've added a separate commit restoring the use of supplied Parquet bounds for both Geometry and Geography. This path consumes `ColumnChunkMetaData::geo_statistics()`, merges the row-group boxes, and serializes Iceberg file bounds. Computing bounds that include curved edges remains the Parquet producer's responsibility; this code does not derive bounds from WKB vertices.
Geography boxes preserve antimeridian wrapping, with full longitude coverage represented as `[-180, 180]`. If any non-null row group has no box, the file bounds remain unknown. With Parquet's default Geography accumulator, which provides no bounds, they are still omitted; bounds supplied by a custom accumulator can now be preserved.
The other requested changes remain in place: the field type travels with the accumulator state, and the tests are split by purpose with explicit XY, XYZ, and wrapping-Geometry coverage. Added focused regressions for supplied Geography boxes and full-longitude unions. All 34 writer tests, `cargo check`, formatting, and Clippy checks pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub)" <gi...@apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4419926351
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -371,6 +371,12 @@ impl MinMaxColAggregator {
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
+ // Statistics are optional, not setting them is fine.
+ // TODO: Implement bounds for geospatial types.
+ return Ok(());
Review Comment:
Updated in 8327373c. The TODO is implemented using Parquet geospatial statistics, including geography bounds supplied by a custom accumulator. I simplified aggregation to a single column-chunk entry point and retained conservative handling of missing row-group bounds. The review also caught a related correctness issue: spatial bounds could make scalar metrics evaluators prune files or incorrectly claim all rows matched. Both evaluators now ignore spatial bounds for scalar comparisons, with a regression check in the writer/manifest/read-back test. The srid:0 Arrow metadata correction is included as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4414965795
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -371,6 +371,12 @@ impl MinMaxColAggregator {
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
+ // Statistics are optional, not setting them is fine.
+ // TODO: Implement bounds for geospatial types.
+ return Ok(());
Review Comment:
This is a very big TODO...geometry and geography written without statistics is a bit of a regression (particularly if other bits of the table have them).
The Parquet stats handling is pretty well defined in the parquet crate, this is possibly easy to do and is the same for Geometry and Geography. (Statistics aren't written by default for Geography, but this can be plugged in at runtime like we do in SedonaDB). Given that this PR is already very small, I think adding here may be a good idea while we're all looking at it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub)" <gi...@apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4419303011
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -371,6 +371,12 @@ impl MinMaxColAggregator {
));
};
+ if matches!(ty, PrimitiveType::Geometry(_) | PrimitiveType::Geography(_)) {
+ // Statistics are optional, not setting them is fine.
+ // TODO: Implement bounds for geospatial types.
+ return Ok(());
Review Comment:
Implemented in 0c0888b8. The writer now consumes ColumnChunkMetaData::geo_statistics and unions row-group boxes by coordinate dimension, including geography wraparound, rather than discarding them or comparing WKB bytes. The resulting Iceberg bounds use Appendix D's little-endian coordinate encoding (with the NaN Z placeholder for XYM). A missing box in any non-null row group makes the file bounds unknown; null-only groups are ignored. This applies equally to geometry and geography statistics supplied by Parquet, including a custom geography accumulator. Parquet's default geography accumulator still does not generate boxes; no global factory is installed here. Also addressed your review note on unset CRS: Iceberg srid:0 now exports without Arrow CRS metadata, including in the embedded Parquet Arrow schema.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "CTTY (via GitHub) via issues" <is...@iceberg.apache.org>.
CTTY merged PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: add geospatial parquet write support [3/3] [iceberg-rust]
Posted by "wirybeaver (via GitHub) via issues" <is...@iceberg.apache.org>.
wirybeaver commented on code in PR #3342:
URL: https://github.com/apache/iceberg-rust/pull/3342#discussion_r4462066525
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -2570,11 +2703,252 @@ mod tests {
(
parquet::basic::Type::FIXED_LEN_BYTE_ARRAY,
16,
- Some(&parquet::basic::LogicalType::Uuid)
+ Some(&LogicalType::Uuid)
)
);
}
+ #[tokio::test]
+ async fn test_geospatial_write_roundtrip() -> Result<()> {
Review Comment:
Split the long lifecycle test into named Parquet payload/metadata round-trip, manifest bounds round-trip, and scalar-metrics safety tests, sharing one file fixture. Added focused XY, XYZ, and wrapping-geometry serialization tests; the wrapping case checks negative/positive infinity for X. Missing statistics and null-only row groups have separate, small aggregation scenarios.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org