Skip to content

API, Core: Revert reading geo bounds as GeospatialBound (#18394) - #19070

Merged
stevenzwu merged 1 commit into
apache:mainfrom
stevenzwu:revert-geospatial-bound-read
Nov 21, 2026
Merged

stevenzwu merged 1 commit into
apache:mainfrom
stevenzwu:revert-geospatial-bound-read

Conversation

@stevenzwu

@stevenzwu stevenzwu commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This is a git revert of ea47af3 from #18394 with one manual conflict resolution in TestV4ManifestReader. #18598 later removed the false tight-stats argument from the new FieldStatsStruct<>(...) call in the geoFieldStats helper that #18394 added. The whole helper is removed in the revert.

#18394 reads geo bounds as GeospatialBound. Readers fill custom structs by position, so projecting a subset of the coordinates, for example only lower_bound.m, stored M as X (discussion). #18394 worked around this by always projecting the full geo bound struct, which reads columns the caller didn't request. @rdblue recommended offline that Iceberg shouldn't project additional data like the entire bound.

The spec says that if either the X or Y dimension is missing, the bounding box is not produced. GeospatialBound represents a bounding-box corner and should guarantee valid X and Y, so it shouldn't represent a partially projected bound. Making it projection-aware would also add a mutable StructLike with stats schema knowledge to the api module.

After this revert:

  • Write path: unchanged. GeospatialBound keeps the read-only StructLike the writer uses.
  • Read path: back to the generic struct, which supports any projection, including m-only, without reading extra columns. A custom core struct for reads didn't seem worth it compared with the generic struct.

The trade-off is that the two paths aren't symmetric: writes take a GeospatialBound, and reads return a generic struct.

Follow-up: ContentStatsBackedMap reads the bound struct by fixed position.


AI assisted conflict resolution.

…pache#18394)"

This reverts commit ea47af3.

Generated-by: Cursor (Claude Opus 5.5)
@stevenzwu
stevenzwu force-pushed the revert-geospatial-bound-read branch from e7adc4b to 3d24636 Compare November 20, 2026 23:20
* deserialization of these bounds to/from byte arrays, conforming to the Iceberg specification.
*/
public class GeospatialBound implements StructLike, Serializable {
public class GeospatialBound implements StructLike {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want Serializable?

@rdblue rdblue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me. Thanks, @stevenzwu!

@stevenzwu
stevenzwu merged commit aae4f59 into apache:main Nov 21, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants