Repository navigation
GeoJSON output format - #108065
Merged
Merged
GeoJSON output format#108065
Conversation
…r than two positions
Contributor
|
I tested this out and the semantics of how it works look good to me |
mneedham
approved these changes
Jun 26, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 26, 2026
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 316/319 (99.06%) | Lost baseline coverage: none · Uncovered code |
1 task
Contributor
|
Hi @nihalzp @mneedham — while reviewing this PR I found the following:
Could you review the test PR and add the |
1 task
pull Bot
pushed a commit
to AKJUS/ClickHouse
that referenced
this pull request
Jul 7, 2026
…ursion bound, and a GEOS differential oracle Adds test coverage for the GeoJSON input/output format (introduced in ClickHouse#108065, closes ClickHouse#91533) that the original PR did not cover: - 04490_geojson_input_geometry_collection.sql: the unrepresentable-geometry policy for MultiPoint and GeometryCollection. By default such features are rejected; with input_format_geojson_unsupported_geometry_handling = 'null' they are validated and stored as NULL. Covers recursive (nested) GeometryCollection validation, an empty GeometryCollection, and confirms a malformed or degenerate member is still rejected in the 'null' mode, so the choice is only unrepresentable-but-valid -> NULL versus throw and never lets malformed data through. Also covers the interaction with format_geojson_validate_geometry and the validation-only path taken when the geometry column is not selected. - 04491_geojson_input_deep_recursion.sh: recursion is bounded by input_format_json_max_depth, so a pathologically nested document raises TOO_DEEP_RECURSION instead of exhausting the parser stack. Exercised for nested GeometryCollections and for strictly skipped ignored values, with the limit lowered so the check is deterministic and cheap. - tests/integration/test_geojson_format: a differential test against Shapely (GEOS), an independent RFC 7946 parser, to catch a consistent misinterpretation that a ClickHouse-only round-trip cannot. Each geometry is round-tripped through ClickHouse (GeoJSON -> Geometry -> GeoJSON) and compared against the oracle. Covers the RFC 7946 Appendix A geometries plus adversarial cases: high-precision coordinates, an antimeridian-crossing line, the silent altitude drop, non-RFC winding-order preservation, and the accept/reject asymmetry for degenerate geometries. Related: ClickHouse#108065
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
GeoJSON output format
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
Query forwarding to external databases (ClickHouse#107740) is based on Denis Vidiaev's ClickHouse#79652, the GeoJSON output format (ClickHouse#108065) on Mark Needham's ClickHouse#98124, and SZ3 (ClickHouse#108788) revives Konstantin Vedernikov's ClickHouse#83088. Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…ursion bound, and a GEOS differential oracle Adds test coverage for the GeoJSON input/output format (introduced in ClickHouse#108065, closes ClickHouse#91533) that the original PR did not cover: - 04490_geojson_input_geometry_collection.sql: the unrepresentable-geometry policy for MultiPoint and GeometryCollection. By default such features are rejected; with input_format_geojson_unsupported_geometry_handling = 'null' they are validated and stored as NULL. Covers recursive (nested) GeometryCollection validation, an empty GeometryCollection, and confirms a malformed or degenerate member is still rejected in the 'null' mode, so the choice is only unrepresentable-but-valid -> NULL versus throw and never lets malformed data through. Also covers the interaction with format_geojson_validate_geometry and the validation-only path taken when the geometry column is not selected. - 04491_geojson_input_deep_recursion.sh: recursion is bounded by input_format_json_max_depth, so a pathologically nested document raises TOO_DEEP_RECURSION instead of exhausting the parser stack. Exercised for nested GeometryCollections and for strictly skipped ignored values, with the limit lowered so the check is deterministic and cheap. - tests/integration/test_geojson_format: a differential test against Shapely (GEOS), an independent RFC 7946 parser, to catch a consistent misinterpretation that a ClickHouse-only round-trip cannot. Each geometry is round-tripped through ClickHouse (GeoJSON -> Geometry -> GeoJSON) and compared against the oracle. Covers the RFC 7946 Appendix A geometries plus adversarial cases: high-precision coordinates, an antimeridian-crossing line, the silent altitude drop, non-RFC winding-order preservation, and the accept/reject asymmetry for degenerate geometries. Related: ClickHouse#108065
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #98124
Closes: #91533
Continuation of:
Additionally, it makes some small bug fixes to the GeoJSON input format like making
idcolumn return typeNullable(String)to differentiate between non-existent null vs empty string.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add the
GeoJSONoutput format for writing GeoJSONFeatureCollectiondocuments, producing one feature per row. The single geo-typed column (Point,LineString,MultiLineString,Polygon,MultiPolygon,Ring, orGeometry) becomes each feature'sgeometry; a column namedidbecomes the featureid; and any remaining columns become the featureproperties, where a lone object-typed column namedproperties(aJSON,Map, or namedTuple) is written directly as thepropertiesobject. ARingis written as a single-ringPolygon. The newformat_geojson_validate_geometrysetting (enabled by default) controls whether geometries that are not valid GeoJSON shapes — such as aPolygonwith fewer than four points or an unclosedPolygonring — are rejected when reading and writing. Additionally, theGeoJSONinput format now infers theidcolumn asNullable(String)instead ofString, so a feature with an absent or explicit"id": nullmember is read asNULLand kept distinct from an empty string"".Version info
26.7.1.148