Repository navigation
Add MultiPoint data type - #109951
Add MultiPoint data type#109951
Conversation
`MultiPoint` is stored as `Array(Point)` and added to the `Geometry` Variant. Geo functions do not support it yet and throw `NOT_IMPLEMENTED`. Since `Variant` sorts alternatives by name, the `Geometry` discriminators are renumbered, which affects backwards compatibility. Resolves ClickHouse#109852
|
@alexey-milovidov Let me know how this looks, two things:
|
Let's add all in this PR. |
|
Workflow [PR], commit [d31235b] Summary: ✅
AI ReviewSummaryThis PR adds the Findings
Final VerdictStatus: |
|
@alexey-milovidov Everything should be implemented now. For backward compatibility MultiPoint is appended to the end of the Geometry variant |
…sentable The `MultiPoint` type is now a first-class `Geometry` type, so `GeoJSON` reading stores it in the `MultiPoint` variant and only `GeometryCollection` stays unrepresentable. The hand-maintained `docs/en/interfaces/formats/GeoJSON.md` already reflected this, but the in-code structured documentation in `GeoJSONRowInputFormat.cpp` (and the regenerated `docs/reference/formats/GeoJSON.mdx`) still described `MultiPoint` as unrepresentable. Update both so the docs match the behavior tested by `04003_geojson_input_format`, `04490_geojson_input_geometry_collection`, and `04510_geojson_multipoint`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…erical} `checkGeometryIntersectArgument` did not allow the named `MultiPoint` type, so a concrete `MultiPoint` argument threw `ILLEGAL_TYPE_OF_ARGUMENT`, and through the `Geometry` type the Variant adaptor treated the `MultiPoint` alternative as incompatible and silently inserted the default result for those rows. Allow `MultiPoint` (the dispatch in `callOnGeometryDataType` distinguishes it by the custom type name), mention it in the ambiguity error for the unnamed `Array(Tuple(Float64, Float64))` form, update the docs, and add regression queries for both concrete `MultiPoint` and `MultiPoint` inside `Geometry`.
…ql_geometry CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109951&sha=bb3d9e1b5ac15619831441c318769e1104f93074&name_0=PR `test_mysql_geometry` failed because `parseWKBFormat` now parses `MULTIPOINT` WKB (this PR made it representable), but `insertGeometryValue` in `MySQLSource.cpp` had no `MultiPoint` branch, so the concrete type name stayed empty and reading a generic `geometry` column holding a MULTIPOINT threw `Cannot store a geometry of type into a Geometry column`. - Serialize the parsed `MultiPoint` in `insertGeometryValue`. - Map MySQL's concrete `multipoint` column type to `MultiPoint` in `convertMySQLDataType` (previously it fell back to `String` because there was no counterpart). - Update `test_mysql_geometry`: MULTIPOINT in a generic `geometry` column now reads back as a value; the unrepresentable-subtype regression uses `GEOMETRYCOLLECTION` instead. - Update the `mysql_datatypes_support_level` setting doc and the MySQL database engine doc: only `GEOMETRYCOLLECTION` has no ClickHouse counterpart now.
|
Pushed fixes for the CI reds of commit bb3d9e1:
Unrelated failures:
|
`convertMySQLDataType` maps MySQL `MULTIPOINT` columns to `MultiPoint`, but `ExternalResultDescription::init` did not route `DataTypeMultiPointName` through the geometry branch, so such columns fell through to `vtArray` and `MySQLSource::insertValue` threw `Unsupported value type` when reading them (`test_mysql_geometry` failure on 5 integration jobs). CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109951&sha=f4b5ef3798509611f5a9aac5056bb242f7432013&name_0=PR PR: ClickHouse#109951 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Pushed d880181 fixing the The remaining two reds on f4b5ef3 are unrelated to this PR:
|
|
CI status on
Merged current master ( The AI-review verdict still shows "Request changes", but all three Majors are marked dismissed by author: they concern the pre-existing structural ambiguity of the geo family ( |
`strAppendGeoValue` picked the concrete geo type for a `Geometry` value from `1..GeoTypes::MultiPolygon`, but the new `GeoTypes::MultiPoint = 8` enumerator sits after `GeoTypes::Geometry = 7` in the proto enumeration, so the fuzzer could never produce a `MultiPoint` alternative inside `Geometry`. Remap a draw of `Geometry` to `MultiPoint` so all seven concrete alternatives are generated uniformly. Addresses the AI review finding on this line. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Update (head
Remaining reds on
The three dismissed threads ( |
|
Acknowledged. Confirmed via CIDB this is a chronic cross-PR/trunk crash, not caused by this PR: |
|
Follow-up: the fix is in #111873. There was no core to pull: the job never wrote one. The only trace of the crash is the watchdog line
With no stack, no core, and in-flight queries unrelated to this PR, the SIGSEGV itself cannot be located, and I am not speculating an engine fix without evidence. #111873 fixes all three diagnostics gaps so the next occurrence of this chronic crash (27 master + ~25 unrelated-PR hits in 30 days) carries the signal name and a collectable core dump. |
`QueryFuzzer::getRandomType` enumerated only the six pre-existing geo type aliases, so this long-running fuzzing path could not generate `MultiPoint` columns or casts. Add `MultiPoint` to the list, matching the `BuzzHouse` generator. Co-Authored-By: Claude Fable 5 <[email protected]>
|
CI on 58b3169 completed: 154 passed, one red — Upgrade check (amd_release), unrelated to this PR:
The AI review verdict flipped to ✅ Approve; the single remaining Nit ( |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 601/688 (87.35%) · Uncovered code |
Master removed ci/tests/test_log_parser.py in 3a69545, which deleted 71 ci/tests files and added to .claude/CLAUDE.md: "you don't need to commit it in the repository, because we don't have automated CI tests". 39 of those files were selectively restored afterwards; this one was not. Taking master's side. The parser and shell changes are unaffected: master's Signal pattern still matches only signal 9, and stress_tests.lib still lacks both the per-start core_path config and the core-limit evidence line. Related: ClickHouse#109951 Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109951&sha=5ec2b2ed5b6cf1fc8ede04ce6756bebc1e281cda&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29
…le core dumps A Stress test (arm_asan_ubsan, s3) server SIGSEGV left no actionable evidence: no BaseDaemon fault stack, no sanitizer report, no core dump, nothing in dmesg. Only a watchdog line survived, and CI reported the opaque "Unknown error". Two independent CI diagnostics gaps caused this, both fixed here: 1. FuzzerLogParser.parse_failure matched only the fault-handler stack (absent for this crash class) or the literal signal 9, so a signal-11 watchdog line fell through to UNKNOWN_ERROR. The Signal pattern now matches any signal, anchored to the watchdog's "<Fatal> Application: " record. The anchor keeps a live-server ShellCommand "Child process was terminated by signal N" exception (server still alive) out of the Signal branch, fixing a pre-existing false positive of the old unanchored pattern too. 2. The server starts via clickhouse start, i.e. through sudo, which clamps RLIMIT_CORE to 0/0, so its startup raise to core_dump.size_limit fails (the recurring "Cannot set max size of core file" warning) and the kernel writes no core. A Defaults rlimit_core="0,infinity" sudoers drop-in in the stress-test image gives the sudo child soft=0/hard=unlimited, so only the server's own startup raise takes effect. Covers the upgrade job (same image). parse_failure only names an already-decided failure, so no new failures are introduced; the independent OOM job-OK allowance is unchanged. Adds 4 parser tests (signal 11, signal 9 KILL, fault-stack-beats-watchdog precedence, ShellCommand false positive). The underlying SIGSEGV is not addressed: with no stack, no core and no reproducer it cannot be located, and no engine fix is speculated without evidence. This makes the next occurrence attributable and debuggable. Related: ClickHouse#109951 Co-Authored-By: Claude Opus 4.8 <[email protected]>
… limit The core destination (<core_path>/cores</core_path>, the only host-mounted directory the job collects) was written by configure_limits, which the stress runner calls only just before its late-phase restart and the upgrade runner never calls. So upgrade-job crashes and early stress-phase crashes wrote their core into the container-local default /var/lib/clickhouse/cores and lost it with the container. Write core_path from configure instead, which every server start in both runners goes through, so a crash at any start lands its core in the collected /cores. The duplicate line is dropped from configure_limits (single writer). start_server now logs the started server's Max core file size from /proc/<pid>/limits as per-run evidence that the sudoers rlimit_core drop-in worked and the soft limit is raisable; the probe is non-fatal (|| :) so it can never fail a start under set -e. Related: ClickHouse#109951 Co-Authored-By: Claude Opus 4.8 <[email protected]>
`convertMySQLDataType` maps MySQL `MULTIPOINT` columns to `MultiPoint`, but `ExternalResultDescription::init` did not route `DataTypeMultiPointName` through the geometry branch, so such columns fell through to `vtArray` and `MySQLSource::insertValue` threw `Unsupported value type` when reading them (`test_mysql_geometry` failure on 5 integration jobs). CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109951&sha=f4b5ef3798509611f5a9aac5056bb242f7432013&name_0=PR PR: ClickHouse#109951 Co-Authored-By: Claude Fable 5 <[email protected]>
…tions `FunctionGeometry::executeImpl` read `ColumnVariant` local discriminators and interpreted them as the global `GeometryColumnType` order. After a variant-to-variant conversion (e.g. `flipCoordinates` over `Geometry` returns a plain `Variant` sorted by name, and the cast back to `Geometry` keeps the source local order), local and global discriminators differ, so `Point` rows were decoded as `Polygon`, `Polygon` rows as `Ring`, etc., producing wrong results or a `BAD_GET` exception. Use `globalDiscriminatorAt` instead and add a regression test covering all Geometry alternatives through `flipCoordinates` both in an expression and through a Memory table. Reported by the AI review on ClickHouse#109951 Co-Authored-By: Claude Fable 5 <[email protected]>
The `mysql_datatypes_support_level` entry in `SettingsChangesHistory.cpp` and the `session-settings.mdx` mirror still described `MULTIPOINT` as having no ClickHouse counterpart, although this PR maps MySQL `MULTIPOINT` to `MultiPoint`. Also regenerate the `flipCoordinates` section of `other-functions.mdx` from the updated `FunctionDocumentation`, which now includes `MultiPoint`. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109951&sha=01b0e292205890653dd65826189752f3c8cc74cc&name_0=PR ClickHouse#109951 Co-Authored-By: Claude Fable 5 <[email protected]>
Add MultiPoint data type
`MultiPoint` was appended to `Geometry` as discriminator 6 (ClickHouse#109951), and a part's columns.txt stores the type by name, so a part written by 25.11..26.7 is read with the 7-variant serialization while it has no `MultiPoint` streams. Reading, merging or mutating such a wide part failed with `Stream g.MultiPoint.size0 ... is not found` (LOGICAL_ERROR), the same for `Array(Geometry)` and `JSON(p Geometry)`, and the `g.MultiPoint` subcolumn of an old compact part failed with `Unexpected substream`. `SerializationVariant` and `SerializationVariantElement` now treat a variant as absent when the reader reports the discriminators stream present but none of the variant's own streams, and skip its prefix, data and stream enumeration. `MergeTreeReaderWide::addStreams` enumerates with the same existence check, so such a column is no longer classified as partially read; otherwise `fillMissingColumns` would replace the read values with defaults and a merge would persist the NULLs. Closes ClickHouse#128592 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Added the
MultiPointgeo data type, stored asArray(Point), and included it in theGeometrytype. Geo functions (readWKT/readWKB,wkt,wkb,svg,area,perimeter,polygons*, MVT encoding, GeoJSON input/output, Arrow/Parquet geo metadata) support it.MySQL integration (the
mysqltable function/engine and the MySQL database engine) maps the concreteMULTIPOINTcolumn type toMultiPoint, and a genericGEOMETRYcolumn holding aMULTIPOINTvalue reads back through theGeometrytype'sMultiPointalternative (previously both threw or fell back toString; onlyGEOMETRYCOLLECTIONremains unrepresentable).To keep backward compatibility,
Geometrynow builds itsVariantwith a fixed discriminator order (matching the previous sorted-by-name order) andMultiPointis appended at the end, so discriminators persisted in existing data keep their meaning. This is covered by the test04511_geometry_discriminators_compatibility, which reads hardcodedNativeandRowBinaryblobs produced by a pre-MultiPointserver.Closes: #109852
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added the
MultiPointgeo data type, stored asArray(Point), and included it in theGeometrytype.Version info
26.8.1.146(included in26.8and later)