Repository navigation
Enrich MVT tests: verify MVTEncode output against the Mapbox Vector Tile spec - #108929
Conversation
….proto The existing MVT tests (04299/04300) assert the encoder output as opaque hex. This adds a test that decodes the bytes produced by MVTEncode back through the official Mapbox Vector Tile 2.1 wire schema and asserts the decoded structure, so the output is verified to be correct according to the standard rather than merely stable. The geometry command streams are checked against the worked examples in the specification (vector-tile-spec 2.1, section 4.3.5): the point, linestring, polygon and multilinestring examples reproduce byte-for-byte. The test also covers equivalence classes (each property type to its Value variant, the feature id, value interning, stringify_unsupported) and boundary values (zoom 0 and 32, extent extremes), and the assertions are demonstrated to fail on a wrong command stream. Requested by @ fm4v on PR ClickHouse#106107. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-4:20260630-111700 |
|
Workflow [PR], commit [30db141] Summary: ❌
AI ReviewSummaryThis PR is a test-only follow-up for Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 141 line(s), 32 function(s) across 60 file(s) · Details Top files
|
CI finish ledger — 30db141CI fully finished (Finish Workflow: success; Mergeable Check: pass). This PR adds a parallel-safe MVT spec-conformance
Session id: cron:our-pr-ci-monitor:20260630-163000 |
36cdb5f
…enrichment Enrich MVT tests: verify MVTEncode output against the Mapbox Vector Tile spec
Related: #106107
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Follow-up to #106107 (merged), requested by @ fm4v: enrich the MVT-function tests with boundary values and equivalence classes, and verify the output against the standard.
The existing tests (
04299_mvt_encode,04300_mvt_clip) assertMVTEncodeoutput as opaque hex. This adds04345_mvt_encode_spec_conformance, which decodes the bytes produced byMVTEncodeback through the official Mapbox Vector Tile 2.1 wire schema (vector_tile.proto, added underformat_schemas/) using theProtobufformat, then asserts the decoded structure. So the output is checked to be correct according to the spec, not merely stable.What it verifies:
(25,17)->[9,50,34]; Linestring ->[9,4,4,18,0,16,16,0]; Polygon ->[9,6,12,18,10,12,24,44,15]; MultiLinestring ->[9,4,4,18,0,16,16,0,9,17,17,10,4,8]. The layer envelope decodes toversion = 2, the requested name/extent and the property keys (§4.1).ClosePathfor a hole); each property type -> itsValuevariant (string/float/double/sint/uint/bool, plusDate->uint_value,Date32->sint_value);feature_id_name->Feature.idexcluded from tags; value interning (shared -> pool size 1, distinct -> pool size 2);stringify_unsupported-> exact decimalstring_value.1and1073741824), world-origin pixel.No existing assertions are weakened. The new assertions are demonstrated to fail on a wrong command stream (a one-unit deviation flips the check), so an encoder regression would be caught.
The test is a parallel-safe
.shtest usingclickhouse-localwith a unique temp filename, and is taggedno-fasttestbecause theProtobufformat requires the protobuf contrib.Version info
26.7.1.348(included in26.7and later)