Skip to content

Support native (GeoArrow) encodings of GeoParquet 1.1 - #129121

Merged
alexey-milovidov merged 3 commits into
masterfrom
geoparquet-geoarrow-encodings
Nov 5, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
geoparquet-geoarrow-encodings

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

GeoParquet 1.1 allows geometry columns to be stored in the native (GeoArrow) encodings point, linestring, polygon, multipoint, multilinestring and multipolygon, i.e. nested lists of struct<x: double, y: double> instead of WKB. GDAL, GeoPandas (geometry_encoding='geoarrow') and DuckDB can write such files. Before this change ClickHouse could not read them at all, not even the schema or the non-geometry columns: Incorrect encoding name in geo json metadata: point.

The layout of these encodings is exactly the layout of the corresponding ClickHouse geo types (Point = Tuple(Float64, Float64), LineString/MultiPoint = Array(Point), Polygon/MultiLineString = Array(Array(Point)), MultiPolygon = Array(Array(Array(Point)))), so the column is read as a regular nested column with the geo type requested, without any decoding:

  • the native Parquet reader: the geo type is used as the type hint of the top-level group, so it is also the inferred type;
  • the Arrow IPC reader and the Arrow library based reader (Arrow Flight etc.): the nested column is converted to the geo type.

A NULL geometry is read as the default value (an empty array or (0, 0)), the same as for WKB. Geometry can be requested explicitly. With input_format_parquet_allow_geoparquet_parser = 0 the columns are read as the underlying nested types. Geometries with Z/M coordinates (a struct with more than two fields) are still rejected with a type mismatch error.

This is a step towards full GeoParquet support, so that ClickHouse can be listed at https://geoparquet.org/.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Support reading GeoParquet 1.1 files with geometry columns in the native (GeoArrow) encodings point, linestring, polygon, multipoint, multilinestring and multipolygon (in the Parquet and Arrow formats). Previously such files could not be read.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/129121]

Version info

  • Merged into: 26.11.1.1429-master (included in 26.11 and later)

GeoParquet 1.1 allows geometry columns to be stored in the native (GeoArrow)
encodings `point`, `linestring`, `polygon`, `multipoint`, `multilinestring` and
`multipolygon`: nested lists of `struct<x: double, y: double>`. Previously such
files could not be read at all, not even the schema, because the parser of the
`geo` metadata threw `Incorrect encoding name in geo json metadata`.

The layout of these encodings is the same as the layout of the corresponding
geo types (e.g. `Polygon` is `Array(Array(Tuple(Float64, Float64)))`), so the
column is read as a regular nested column with the geo type requested, in the
native Parquet reader, the Arrow IPC reader, and the Arrow library based reader.
A NULL geometry is read as the default value, the same as for WKB, and
`Geometry` can be requested explicitly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1f92042]

Summary: ✅


AI Review

Summary

Adds support for all six GeoParquet 1.1 native geometry encodings in the Parquet and Arrow readers, including schema inference and explicit Geometry reads. The previous case-insensitive metadata lookup finding is fixed in 1f92042df76090c33e20d2beb6005966cb903e07. No new actionable findings remain.

Missing context / blind spots
  • ⚠️ Runtime probes used the available CI binary from 50dfbd73c62dfd20b37a33f8ca99655dfaa8932f; the later case-insensitive fixes and regression cases were checked in current source. PR-head builds and targeted tests were still pending or running. A passing head run of 05497_geoparquet_native_encodings would close this validation gap.
  • ⚠️ The Arrow library conversion branch was inspected but not exercised at runtime; the probes covered the native Parquet and Arrow IPC readers.
Final Verdict

✅ Approve — no unresolved review findings. PR-head CI validation remains pending.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Nov 3, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). label Nov 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 1f92042df with master d6bf47a42 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 6a59c7376; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

36 translation units recompiled, 296 s compile time in total, 36 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×0.94 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost -18.1 s (-6%) in total before that adjustment.

Job report

alexey-milovidov and others added 2 commits November 5, 2026 01:07
With `input_format_parquet_case_insensitive_column_matching` or
`input_format_arrow_case_insensitive_column_matching`, a requested column `POINT`
matches the file column `point`, but the `geo` metadata is keyed by the name in the
file, so the native encoding was not found and `Geometry` reads failed. Keep the
name according to the parquet schema in `parquet_name` and use the Arrow field name
in the Arrow reader.

Also exclude the new fixture from `00900_long_parquet_load_2`, as other GeoParquet
fixtures tested separately.

Address review: #129121 (comment)
CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129121&sha=50dfbd73c62dfd20b37a33f8ca99655dfaa8932f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Very good.

@alexey-milovidov alexey-milovidov self-assigned this Nov 5, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 5, 2026
Merged via the queue into master with commit 18914b8 Nov 5, 2026
186 checks passed
@alexey-milovidov
alexey-milovidov deleted the geoparquet-geoarrow-encodings branch November 5, 2026 16:53
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 5, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 12, 2026
Two semantic conflicts with master made the merge-queue run fail
(MergeQueueCI run 43079186130, merge commit 9948f7e):

- ClickHouse#129121 added a call to `reinterpretRawByteColumns` for native
  GeoArrow columns, while this branch gave that function a
  `repair_variants` parameter. Pass `true`, as the other materialized
  column call in `buildChunk` does; the geo target type has no
  `Variant`, so the value does not change the result.
- ClickHouse#126530 extended the `-WithMemoryTracking` container style rule to
  `src/Processors/Formats`; use `VectorWithMemoryTracking` in
  `variantElementTargets`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants