Repository navigation
Conversation
### What problem does this PR solve?\n\nIssue Number: close apache#28228\n\nRelated PR: apache#67907\n\nProblem Summary: Preserve parameterized geometry and geography types through Nereids function binding and add the geography WKB constructor on master.\n\n### Release note\n\nAdd spatial function type binding for geometry and geography values.\n\n### Check List (For Author)\n\n- Test: FE focused test pending; BE build pending\n- Behavior changed: Yes (spatial function return and input types)\n- Does this need documentation: No
Align generated Nereids spatial constructors with the native Geometry return type and preserve spatial inputs for ST_ASTEXT.
Record the master-port decisions, focused FE test result, and remaining BE and format gaps.
Add Geometry and Geography to the BE Iceberg schema model, preserve their Arrow binary metadata, and reject spatial values in internal-table DDL including nested containers.
Allow Arrow and Parquet binary materialization to operate on the spatial column container while preserving existing VARBINARY behavior. ### Check List (For Author)\n\n- Test: FE DDL test pending; BE build pending\n- Behavior changed: Yes (spatial binary read/write)\n- Does this need documentation: No
Allow spatial functions to consume raw WKB columns and preserve canonical WKB bytes in geometry and geography constructors. ### Check List (For Author)\n\n- Test: BE unit test pending; FE tests unaffected\n- Behavior changed: Yes (spatial WKB function inputs)\n- Does this need documentation: No
Reject malformed spatial payloads before geo functions execute and expose the validator for Iceberg write paths. ### Check List (For Author)\n\n- Test: BE unit test pending; dependency setup still blocks BE build\n- Behavior changed: Yes (invalid spatial input errors)\n- Does this need documentation: No
Emit top-level Geometry and Geography logical annotations in Iceberg Parquet files, validate WKB inputs before conversion, and reject nested spatial columns that the writer cannot represent. ### Check List (For Author)\n\n- Test: C++ writer test added; BE build pending dependency setup\n- Behavior changed: Yes (Iceberg Parquet schema and input validation)\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: Validate raw spatial WKB inputs before spatial functions and Iceberg writes while preserving Geography SRID compatibility.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: FE focused tests passed; BE build blocked during third-party submodule preparation\n- Behavior changed: Yes (invalid Geometry WKB is rejected earlier)\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: Remove stale comments that described explicitly supported Iceberg spatial types as unsupported and record the current validation commit in the work log.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: No need to test; comment and worklog only\n- Behavior changed: No\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: The mapping implementation handles Geometry and Geography explicitly, but its fallback comment still listed them as unsupported.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: No need to test; comment only\n- Behavior changed: No\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: Add an external Iceberg V3 regression that creates a Geometry table, writes raw WKB through Doris, reads it back from Parquet, and checks ST_AsText output.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: Added gated external Iceberg regression; not run because the external Docker environment is unavailable\n- Behavior changed: No\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: Generic connector sink coercion could hide Geometry/Geography kind, CRS, and edge-algorithm mismatches before Iceberg writes. Validate spatial source expressions against target metadata before the common coercion path, while preserving NULL writes.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: ./build.sh --fe; FE_UT_PARALLEL=1 ./run-fe-ut.sh --run org.apache.doris.datasource.connector.converter.ConnectorSpatialWriteValidatorTest\n- Behavior changed: Yes (invalid spatial write conversions fail during analysis)\n- Does this need documentation: No
### What problem does this PR solve?\n\nIssue Number: N/A\n\nRelated PR: apache#67907\n\nProblem Summary: Adding external-only spatial primitive types left the exhaustive storage-field mapping without explicit cases, causing BE compilation to fail under -Werror.\n\n### Release note\n\nNone\n\n### Check List (For Author)\n\n- Test: BE build resumed after this compile fix\n- Behavior changed: No; spatial types still reject internal segment storage\n- Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Align spatial serialization with current master APIs. Put optional spatial metadata on PScalarType, adapt generic binary SerDe to StringRef and Arrow offsets, remove obsolete column overrides and version constants, and verify Parquet CRS through concrete logical types. ### Release note None ### Check List (For Author) - Test: ./build.sh --be passed; BE spatial unit tests compiled but ASAN linking failed due toolchain duplicate glibc symbols; release retry pending - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Connector changelog UPDATE and MERGE plans returned before the generic sink validator, allowing spatial metadata to be coerced without checking kind, CRS, or geography algorithm. Validate each changelog expression before casting and cover both paths with plan-builder tests. ### Release note None ### Check List (For Author) - Test: FE connector spatial and changelog plan tests, 13 tests passed - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Geography values created without explicit metadata are valid under the Iceberg V3 default contract, but the BE type constructor rejected an empty algorithm. Normalize the default to spherical while preserving Geometry and explicit metadata semantics. ### Release note None ### Check List (For Author) - Test: focused BE gtest exposed and isolated the default metadata case; follow-up spatial suite in progress - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Keep projected Geometry accessors in raw WKB space, validate S2 Geography metadata before execution, preserve legacy encoded WKB plans and current master geo functions, fix spatial serialized-size accounting, and use the supported Parquet group annotation API. Cover projected Geometry and legacy EWKB with focused tests. ### Release note Spatial metadata mismatches fail explicitly rather than using incorrect spherical semantics. ### Check List (For Author) - Test: run-be-ut.sh, 86 tests passed with ASAN and local GLIBC_COMPATIBILITY=OFF; clang-format 16.0.6; build hygiene passed; clang-tidy in progress - Behavior changed: Yes, reject unsupported spatial metadata - Does this need documentation: Yes, pending spatial feature documentation
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Apply clang-format 16 to the spatial feature scope and resolve new auto and integer sign comparison diagnostics while retaining verified geo behavior. ### Release note None ### Check List (For Author) - Test: run-be-ut.sh, 86/86 passed with ASAN and local GLIBC_COMPATIBILITY=OFF; check-format.sh passed; whitespace and build hygiene passed - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: Resolve qualified-auto diagnostics in the new spatial column implementation and record verified personal test service health. ### Release note None ### Check List (For Author) - Test: full feature clang-tidy in progress; existing spatial BE suite passed 86/86 before these qualifier-only changes - Behavior changed: No - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#67907 Problem Summary: ST_AsBinary copied Geometry WKB directly while ignoring the nullable column null map. Propagate NULL before copying raw bytes and test accessors with valid hidden payloads. Also resolve the fixed binary width integer-comparison diagnostic. ### Release note ST_AsBinary returns NULL for nullable Geometry input rows. ### Check List (For Author) - Test: run-be-ut.sh, 87/87 spatial and geo tests passed with ASAN and local GLIBC_COMPATIBILITY=OFF - Behavior changed: Yes, preserve NULL results - Does this need documentation: No
### What problem does this PR solve? Issue Number: N/A Related PR: apache#67907 Problem Summary: Iceberg spatial schemas have native Doris types, but SQL CREATE and ALTER cannot declare them. Add Geometry and Geography grammar with CRS and edge algorithm parameters, preserve their use as non-reserved column names, and normalize supported Geography algorithms in the shared type factory. Dispatch column types through the parser visitor so CREATE and ALTER use the same type parsing path. ### Release note Allow GEOMETRY and GEOGRAPHY declarations with CRS and Geography edge algorithm parameters for Iceberg external tables. ### Check List (For Author) - Test: Unit Test; standard run-fe-ut.sh, DataTypeTest 38/38 and ColumnDefinitionTest 8/8 passed, fe-spatial-ddl-ut.log BUILD SUCCESS - Behavior changed: Yes; SQL recognizes parameterized spatial types and rejects unsupported Geography algorithms - Does this need documentation: Yes; spatial external-table documentation pending
### What problem does this PR solve? Issue Number: N/A Related PR: apache#67907 Problem Summary: Iceberg CREATE and column evolution can introduce spatial columns on V2 or non-Parquet tables, or introduce nested spatial values that Doris cannot write. Validate these constraints before remote schema mutations. CREATE uses effective catalog override, request, and default properties; ADD and MODIFY use actual table metadata and the writer's existing format resolution, including the write-format alias. Ordinary column changes retain their existing path. ### Release note Reject Iceberg spatial schema changes that require unsupported table versions, write formats, or nested spatial writes. ### Check List (For Author) - Test: Unit Test; standard run-fe-ut.sh via personal wrapper, IcebergSpatialDdlTest 8/8, metadata DDL 37/37 and column evolution 23/23 passed, fe-spatial-spi-ddl-ut.log BUILD SUCCESS - Behavior changed: Yes; unsupported spatial schema changes fail before remote mutation - Does this need documentation: Yes; spatial external-table limitations documentation pending
|
/review |
There was a problem hiding this comment.
Static review of e27809effd8a021885afb0d00be0e99d0fc12a14, covering all 216 changed files and their applicable upstream/downstream paths. Two new P2 findings: the connector version-wiring regression expects API 30 although this PR serves API 31, and ordinary Polygon/Line containment performs a full polygon-edge scan for every line vertex. See the inline comments. No additional user focus was supplied.
Critical checkpoint conclusions:
| Checkpoint | Conclusion |
|---|---|
| Goal and evidence | Native Iceberg V3 spatial identity/read/write plumbing matches the documented subset; unit and regression cases cover positive and rejected operations. The version test has the verified mismatch reported inline. |
| Scope and reuse | Broad but cohesive feature change; shared binary SerDe/serialization and existing planner/connector paths are reused. No unrelated production change identified. |
| Concurrency | External schema/format changes can race preflight. The DDL adapter checks actual SDK commit candidates and preserves CAS/retry behavior. No new worker/shared-state race verified. |
| Lock cost and ordering | No new lock hierarchy or heavy work under an introduced lock found. |
| Lifecycle and initialization | Owning spatial copies, arena retention/trim, non-owning DDL adapters and writer-close-before-cleanup paths were traced. No new supported-path lifetime or static-initialization defect verified. |
| Configuration | No new runtime configuration item. |
| Compatibility | Connector API 31 requires plugin rebuilds. VARBINARY Block layout and legacy STRING GIS routes are retained. Mixed 4.x/5.0 spatial execution remains explicitly excluded by the approved scope, not fixed by this PR. |
| Thrift/protobuf allocation | Read every touched definition on HEAD and live-verified 3.1/4.0/4.1/4.2/master refs. New fields are optional; explicit spatial IDs avoid the reserved FILE identities. No introduced collision/reuse found. |
| Parallel paths | Checked scalar/nested types, typed/legacy functions, INSERT/UPDATE/MERGE, schema/default/equality-delete transport, aggregate/state/rewrite admission, grouping/set/window keys, runtime filters and client projections. No additional verified omission. |
| Conditional/error paths | Unsupported dimensions/metadata/operations fail explicitly. NULL provenance and cast checks preserve ordinary siblings and original errors. Dynamic required LIST NULLs reach Arrow's explicit required-leaf rejection. |
| Test coverage | Inspected positive/negative cases for metadata, nullable/const materialization, DDL retries, nested requiredness, planner identities, ownership and numerical boundaries. No build or test executed for this review. |
| Changed results | Inspected regression projection shapes, NULL/EMPTY/byte expectations and boundary controls. No further substantiated mismatch; exhaustive numerical recomputation was not performed. |
| Observability | Existing scan/connector profiling and explicit operation/metadata errors cover the new paths; no additional logging/metric defect verified. |
| Persistence and failover | Spatial parameters use existing Gson/Thrift/protobuf metadata channels; no new EditLog operation. External snapshot commit/retry remains delegated to Iceberg. No new failover defect verified. |
| Data writes and atomicity | Schema/write admission and failed-writer cleanup were traced through commit reporting. No new supported-path atomicity or cleanup defect verified. |
| FE/BE transport | Kind/CRS/algorithm are retained across descriptors, nested schema carriers and serialization. Remote constant folding still excludes spatial values FE cannot decode. |
| Performance and final rethink | Verified a distinct quadratic Polygon/Line side-admission path: a 320,070-byte input pair forces 100,020,000 point-edge distance calls before containment. Reported inline; counts derive from source, not a benchmark. Other ownership/resolution/candidate paths were rechecked. |
Prior P1 dispositions were independently checked: nullable COUNT (4269360799), FILE ID reuse (4384986088), portable wide arithmetic (4402847165), dimension admission (4434477659) and ORC casts (4469669669) are fixed. Bearing (4409568560) uses the full-angle sine; identity partitions (4426807465) are rejected by the pinned Iceberg transform; polygon interiors (4428917878) are included by the pinned S2 query and target defaults. Mixed-version finding 4430686953 is outside the explicit maintainer-approved scope. No existing in-scope P0/P1 remains independently confirmed, so the blocking-ID set is empty. Known prior findings were not duplicated.
Validation limits: static inspection only; no current-head build, test, benchmark, external-engine run or exhaustive numerical proof. The false/true scanner-flag loops both select current V2 and are not independent V1/V2 validation. Earlier author-reported passes do not establish current-head CI. Documented unsupported formats/algorithms, direct spatial Flight schemas and mixed-version execution remain scope boundaries. No unresolved concrete review candidate remains.
Review converged after 3 round(s).
### Background Geography containment uses exact checks on original coordinates to reject ambiguous rounded boundaries. Connector plugins are gated by the SPI major served by the FE. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (review follow-up) PR Type: Performance Problem Summary: Contains and Within visited every polygon edge for every line vertex even when the line stayed far inside the polygon. The connector version-wiring test also still asserted API 30 after the switch to API 31. ### Details - Why it was slow: the Polygon/LineString path ran a raw boundary walk and a second original-edge distance walk per line vertex before containment. - Optimization: query the rounded boundary for each line vertex and query an index of line vertices from the original short edges. Keep the original exact predicates for candidates and the direct side check for long arcs. Align the FE version assertion and old-plugin probe to majors 31 and 30. - Results: add a work-count regression for increasing interior input sizes in both operand orders. No elapsed-time result is claimed. - Applicability and cost: Polygon/LineString containment only; the per-call line index stores one entry per vertex. Other relation paths and the existing long-arc behavior are retained. ### Testing - Passed all 14 PluginApiVersionWiringTest cases with the repository FE UT runner. - Compiled the Geography production and test translation units with the Clang 21 ASAN build flags. Clang-format 16, changed-line clang-tidy, build hygiene, and diff checks passed. - Standard VGeoFunctionsTest run did not execute: the local Lance header lacks lance_scanner_set_distance_range. ### Release note None. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: the BE test binary could not be built with the installed Lance dependency. ### AI Disclosure - Tool: Codex - Generated: implementation, regression, and commit description - Human review: not stated
### Background Hive exposes Parquet binary columns as VARBINARY in Doris. Parquet can also attach GEOMETRY or GEOGRAPHY annotations to the same physical bytes. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: Hive BINARY scans must still return raw WKB even when the file advertises a spatial logical type. The Hive reader selects the ordinary byte-array mapping and the footer cache distinguishes it from the typed Iceberg mapping. ### Details - **Frequency:** Hive reads of Parquet BINARY columns with spatial annotations. - **Root cause:** The shared Parquet schema parser interpreted those annotations for all readers. - **Why existing tests missed it:** They covered typed spatial columns and unannotated byte arrays separately. - **Fix:** Apply a Hive-specific mapping policy and include it in the footer cache key. - **Other paths and branches:** Iceberg and direct file scans keep typed spatial decoding. ### Testing The changed C++ compile units passed syntax checks with Doris build flags. The standard BE test build stopped before running tests because the installed Lance header does not expose lance_scanner_set_distance_range. Added coverage for plain and dictionary reads, NULL, and cache isolation. ### Release note Hive BINARY continues to return raw bytes for Parquet columns with spatial annotations. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: BE runtime tests need a matching Lance dependency. ### AI Disclosure - Tool: Codex - Generated: Fix, test, and commit description. - Human review: Pending.
### Background Doris maps Iceberg v3 spatial types to native GEOMETRY and GEOGRAPHY and uses the native Parquet reader and writer for spatial columns. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: Keep small spherical direction angles and non-spatial Arrow metadata. Make spatial write and MAP validation distinguish spatial values from ordinary siblings and keys. Remove duplicate scans from the Iceberg suite. ### Details - **Change map:** Geography calculations and Parquet footer metadata in BE; MAP and connector write legality in FE; focused unit tests and Iceberg regression cleanup. - **Frequency:** Small positive geography bearings; mixed spatial and VARIANT writes; the affected MAP and projected INSERT SELECT forms. - **Root cause:** Angle normalization rounded before wrapping; the native writer did not preserve the Arrow schema; type checks validated whole shapes where only specific positions needed constraints. - **Why existing tests missed it:** They did not cover tiny directions, mixed schemas, or these expression shapes. - **Fix:** Normalize signed angles before narrowing, preserve schema metadata, and validate or retarget by position. - **Other paths and branches:** Both predicate pushdown settings and raw versus annotated reads remain covered. Legacy string geography calculations are unchanged. ### Testing All 84 focused FE tests passed across four suites. The 10 affected C++ compile units passed syntax checks with Doris build flags. The standard BE test build was blocked before test execution by a mismatched Lance header. The existing Iceberg golden values agreed across the removed duplicate runs. ### Release note Iceberg spatial writes preserve compatible non-spatial types. Geography direction calculations retain small positive angles. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: BE runtime and external Iceberg tests remain to run. ### AI Disclosure - Tool: Codex - Generated: Fixes, tests, regression cleanup, and commit description. - Human review: Pending.
### Background Geography computes signed bearings at wide precision and narrows the normalized result to double. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Refactor Problem Summary: Make the full-turn rounding case explicit and follow the changed-line clang-tidy rules for cast initialization. Separate test fixture setup and assertions while keeping the same inputs. ### Details - **Moves vs. logic changes:** Use an early return for the full-turn case; all comparisons and return values are unchanged. - **Behavior change:** None. - **Compatibility:** Existing inputs and results are unchanged. - **Performance impact:** None expected. - **Rollback:** Revert this commit. ### Testing Checked the changed lines with clang-format 16 and clang-tidy. Compiled the modified production and test units with the Doris BE configuration. An isolated run of the production geography functions passed seven assertions. ### Release note None. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: the standard BE test build still needs a matching Lance dependency. ### AI Disclosure - Tool: Codex - Generated: Source cleanup and commit description. - Human review: Pending.
### Background Legacy STRING distance functions accept S2-encoded shapes. Direct Parquet table-valued functions infer a file schema before the FE can project columns. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: An invalid STRING distance constant caused unnecessary per-row shape decoding. A spatial annotation in a directly read Parquet file prevented binding all columns, including ordinary columns. ### Details - **Frequency:** Invalid legacy distance constants or direct reads of Parquet files with spatial annotations. - **Root cause:** Distance evaluated both operands before detecting the failed constant, and the direct file schema path inferred typed spatial columns. - **Why existing tests missed it:** They did not distinguish constant-block NULL handling or require direct-file reads of annotated and unannotated WKB to agree. - **Fix:** Restore the constant short circuit and select the byte mapping during both file schema inference and direct scans. - **Other paths and branches:** Typed Iceberg reads retain spatial decoding and use the existing footer cache separation. ### Testing Affected C++ compilation units, format, and build hygiene checks passed. The standard BE run stopped before tests at the installed Lance C header, which lacks lance_scanner_set_distance_range. Added a direct schema case and SQL comparisons for ordinary projection and raw WKB. ### Release note Direct Parquet reads continue to expose spatially annotated WKB as bytes. An invalid legacy distance constant returns NULL for the block without decoding the other operand for each row. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: BE runtime and external SQL cases need a matching Lance dependency. ### AI Disclosure - Tool: Codex - Generated: Code, tests, and commit description. - Human review: Pending.
### Background Geography relations and directions use raw spherical coordinates alongside S2. Iceberg spatial writes validate proven NULL leaves before sink coercion. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: Keep independently proven line contacts and tiny relative turns. Retag spatial NULLs in their original Project across sorting and limiting and through a valid outer MAP cast. Make the mixed-schema Arrow test independent. ### Details - **Frequency:** Rounded endpoint pairs with a separate shared vertex, tiny relative angles near east, and the affected INSERT SELECT forms. - **Root cause:** Endpoint ambiguity ignored independent raw evidence, absolute bearing rounding erased their difference, and the write normalizer validated or stopped before reaching the producer. - **Why existing tests missed it:** They covered rounded-only contact, near-north angles, and direct constructors separately. - **Fix:** Use the raw vertex witness and tangent determinant, preserve bound project scope and cast legality, and register Variant in the test process. - **Other paths and branches:** Preserve ambiguous rounded-only contact errors, sort keys, row limits, required leaf validation, and ordinary cast types. ### Testing All 86 focused FE tests passed. An independent process reproduced both new FE failures using the prior normalizer and passed with this change. The production Geography angle returned zero on the previous commit and the expected nonzero result after the change. Affected C++ compilation units passed syntax checks. The standard BE run could not execute tests due to an installed Lance header. ### Release note Spherical relative angles and verified line contact retain their results. Iceberg writes accept proven spatial NULLs under sorting and limiting or a compatible outer MAP cast. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: full BE unit tests and external regression require a matching Lance dependency. ### AI Disclosure - Tool: Codex - Generated: Code, tests, and commit description. - Human review: Pending.
### Background Iceberg reads spatial Parquet annotations as native types. Other Parquet consumers expose the physical byte arrays through existing column types. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: Broker LOAD uses a dedicated table reader and missed the byte-mode selection added for Hive and direct reads. Valid WKB such as TRIANGLE was rejected before an ordinary STRING destination could receive it. ### Details - **Frequency:** Ordinary Parquet loads with a spatial annotation and WKB outside Doris's native calculation subset. - **Root cause:** Typed mapping was the default. Only specific callers overrode it. - **Why existing tests missed it:** The annotated fixtures exercised Hive and direct schema inference, not the load reader. - **Fix:** Retain byte mapping by default and explicitly select typed mapping at Iceberg data and delete-file reads. - **Other paths and branches:** The reader's existing cache key keeps byte and typed schemas distinct. Hive and TVF retain their previously restored behavior. ### Testing Clang syntax checks, changed-line lint, format and build hygiene passed. Added a load-reader test using the same bytes with and without a spatial annotation. The standard BE build stopped at a mismatched Lance C header before executing unit tests. ### Release note Ordinary Parquet loads retain raw WKB bytes for spatially annotated columns. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: BE runtime needs a matching Lance header. ### AI Disclosure - Tool: Codex - Generated: Fix, focused test and commit description. - Human review: Pending.
### Background Default-spherical Geography calculations use original WKB coordinates to distinguish real contact from binary64 rounding. Iceberg writes retag proven NULL leaves before sink coercion. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: A rounded endpoint could hide a separate proper line crossing. Nearly identical non-cardinal tangents could erase a representable turn. ORDER BY CARDINALITY, MERGE and VALUES could reject a compatible spatial MAP containing proven NULLs. ### Details - **Frequency:** Unrelated rounded endpoints, nearly identical bearings, or the affected MAP write expressions. - **Root cause:** Missing independent crossing witness, cancellation after tangent rounding, or type validation before spatial NULL retagging in the owning scope. - **Why existing tests missed it:** They covered shared line vertices, axis-adjacent angles, simple order keys and ordinary literal MAP keys. - **Fix:** Recall crossing candidates with S2 and reuse raw orientation proof. Recompute the uncertain angle numerator from raw endpoint differences. Preserve sort cardinality and bind the original MERGE/VALUES cast before retagging. - **Other paths and branches:** Keep unproven contacts ambiguous, ordinary key conversion and branch evaluation in place, and validate illegal original casts. ### Testing Focused FE suites and independent Geography checks ran. C++ changed-line lint, syntax, format and build hygiene passed. The external SQL script compiled. Standard BE tests and the external SQL regression need a matching Lance C header. ### Release note Geography retains independently proven crossings and small relative turns. Iceberg writes accept compatible spatial MAP values with proven NULL leaves in the affected sorting, MERGE and VALUES paths. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: BE unit tests and external SQL remain to execute. ### AI Disclosure - Tool: Codex - Generated: Fixes, tests and commit description. - Human review: Pending.
### Background FE Checkstyle limits source lines to 120 characters. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (Iceberg spatial type support) PR Type: Bugfix Problem Summary: A 123-character line in the connector spatial write normalizer failed Checkstyle. ### Details - **Frequency:** Every Checkstyle run on the affected source. - **Root cause:** The method call and its arguments were on the same line. - **Why existing tests missed it:** The error is a formatting violation rather than a runtime failure. - **Fix:** Wrap the argument list without changing the expression. - **Other paths and branches:** None. ### Testing Ran Maven checkstyle:check from fe with JDK 17. The FE reactor passed. ### Release note None. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex - Generated: Formatting change and commit description. - Human review: Pending.
### Background Typed Geography uses spherical calculations. Iceberg spatial writes normalize known NULLs before converting values to their destination types. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (follow-up) PR Type: Bugfix Problem Summary: Distinct LineString vertices can round to the same spherical coordinate and report a false contact. Near-collinear turns between equatorial endpoints can lose a representable angle. Iceberg spatial writes can reject legal STRUCT casts or a STRUCT that contains both a matching spatial slot and a known NULL. ### Details - **Frequency:** Triggered by near-coincident Geography coordinates or the affected nested spatial writes. - **Root cause:** The contact check only compared endpoints, the angle fallback discarded a cancellation-free product, and the write normalizer missed STRUCT casts and matching slots. - **Why existing tests missed it:** The earlier cases covered endpoint contacts, other near-collinear turns and dynamic MAP writes. - **Fix:** Check rounded line vertices and reuse raw contact witnesses. Keep the equatorial determinant product. Retag proven spatial NULLs while preserving legal STRUCT casts and matching bound slots. - **Other paths and branches:** Original cast validation and ordinary sibling conversions still apply. - **Behavior change:** Ambiguous rounded line contacts raise the existing error, equatorial turns retain their sign, and the covered STRUCT writes accept spatial NULLs. ### Testing - Ran 155 BE Geography tests with the ASAN unit-test runner and 211 targeted FE tests. - Confirmed the previous commit fails the new Geography and FE regression scenarios. - Passed Checkstyle, changed-line Clang checks and git diff --check. ### Release note Geography relations and angles handle the covered near-coincident coordinates correctly. Iceberg STRUCT writes preserve proven spatial NULLs. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: OpenAI Codex - Generated: Code, regression tests and commit message - Human review: Pending
|
run buildall |
|
/review |
There was a problem hiding this comment.
Reviewed exact head 5cdac8ce51a404438b08cc100591851330b5fb97. Three new P2 findings are attached: inconsistent UNION ALL branch types after spatial NULL normalization; incorrect MAP-constructor exception expectations in the external suite; and premature spatial validation for existing Iceberg BINARY fields. Each was independently verified and deduplicated against the existing threads.
The coverage inventories account for all 231 changed paths: FE/regression 149 and BE/gensrc 82, with a separate risk review of Geography precision and NULL normalization. There was no additional user-provided focus.
Critical checkpoint conclusions:
- Goal and behavior: Native Iceberg V3 spatial metadata, raw WKB storage, Parquet I/O and constrained typed functions are implemented. The attached supported-write/read failures prevent a clean correctness conclusion.
- Scope and reuse: This is a broad spatial feature across type, connector and execution boundaries. Shared binary serialization, SerDe and existing planner/connector helpers keep the changes related; no unrelated feature change was identified.
- Concurrency and locks: No new thread or lock protocol was introduced. Existing SDK CAS/retry and asynchronous file-close interactions were traced; no additional verified concurrency defect was found.
- Lifecycle and initialization: Reviewed column COW/arena ownership, owning aggregate/Field states, nullable/constant paths and failed-open cleanup before object deletion. No additional verified lifecycle or static-initialization issue was found.
- Configuration: No new runtime configuration needs dynamic propagation. Annotation interpretation is a reader contract, and the metadata-cache key includes that mode.
- Compatibility: Connector API 31.0 and the API-30 rejection test agree. Legacy STRING spatial signatures remain separate. The BINARY read regression is attached. Mixed 4.x/5.0 spatial execution remains the existing explicit maintainer scope decision; participating nodes must support the new types.
- Thrift/protobuf: Compared every touched definition with live-verified master, branch-3.1, 4.0, 4.1 and 4.2. New fields are optional; spatial enum allocation preserves branch-4.1 FILE's protobuf45/Thrift47 identities. No new collision was found.
- Parallel paths: Covered INSERT VALUES/SELECT, UPDATE, MERGE/changelog/rewrite; CREATE/ALTER; scalar/nested/state/window/aggregate admission; generic Hive/load versus Iceberg; and data/default/equality-delete carriers. The UNION and Iceberg BINARY gaps are attached.
- Conditional checks: Guards correspond to concrete unsupported operations, formats, metadata or NULL provenance. No additional verified guard defect was found after checking upstream guarantees.
- Test coverage: Substantial positive/negative FE, BE and integration coverage exists in source. Missing combinations include whole-NULL/non-NULL UNION containers with ordinary sibling widening and actual-file decoding through an Iceberg BINARY schema.
- Expected results: Current golden section shapes, including the corrected three-column Z/M projections, were inspected. The MAP-constructor expectation mismatch is attached. Generated-output provenance and current-head execution were not verified.
- Observability: Existing rejection paths retain relevant row/type/column/CRS/format context. No additional verified logging or metrics defect was identified.
- Persistence and failover: Spatial identity uses existing recursive type/schema carriers; existing Iceberg commit/conflict handling is retained. No new journal or transaction state machine was introduced.
- Writes and atomicity: Checked pre-coercion identity validation, format/CRS admission and failed-writer cleanup. Dynamic required-list NULLs are also rejected by the existing Arrow 24 writer boundary. No additional verified commit/atomicity defect was found.
- FE/BE transport: Kind, CRS and algorithm propagate through scalar/column descriptors and historical schemas. The recursive BE-folding exclusion remains for values FE cannot decode; no new session-variable transport is needed.
- Performance: Reviewed arena retention, binary transfer, spatial noding/index recall and indexed Polygon/Line containment. Known nullable-selection batching and general dense-Polygon work remain previously discussed limits. No benchmarks or measured speed claims were made.
- Other issues and existing reviews: All three accepted new findings are inline. Prior P1 COUNT-nullability, FILE-ID reuse, portable-wide-arithmetic, dimensional-validation and ORC-cast concerns are fixed in source. The bearing allegation is not the actual code; the polygon-distance and spatial-partition allegations are ruled out by the pinned S2 query and Iceberg identity transform. No existing in-scope P0/P1 finding was independently confirmed as still applicable, so none is duplicated or carried as a blocking ID.
Validation was static only: no builds, SQL execution, tests, benchmarks, fixture runs, source edits or submodule initialization. Runtime behavior and exhaustive numerical correctness are not claimed. There are no unresolved concrete candidates or unassigned changed paths after the final challenge; process convergence is recorded separately by the submission helper.
Review converged after 2 round(s).
### Background Iceberg spatial writes retag proven NULLs before sink binding. Parquet files can also carry annotations that a table imports under its BINARY type. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (follow-up) PR Type: Bugfix Problem Summary: Spatial NULL retagging can leave UNION ALL branches with different ordinary STRUCT field types. The spatial regression suite can expect an outer function error even when the inner MAP constructor fails first. Iceberg can validate an annotated BINARY value as spatial WKB before it reaches the binary table column. ### Details - **Frequency:** Triggered by the covered UNION writes, spatial MAP tests or annotated Iceberg BINARY imports. - **Root cause:** UNION ALL used its first branch's retagged schema, the tests assumed outer-function validation happened first, and file materialization relied on the spatial annotation. - **Why existing tests missed it:** The earlier coverage exercised like-typed UNION branches and separate typed-spatial or Hive byte paths. - **Fix:** Coerce normalized UNION branches to their common type. Assert the constructor error for spatial MAP keys. Use the raw byte type for matched Iceberg BINARY leaves in the split-local Parquet schema. - **Other paths and branches:** Keep normal spatial decoding for fields declared GEOMETRY or GEOGRAPHY. - **Behavior change:** The covered UNION writes produce a consistent schema and annotated BINARY imports preserve their payloads and NULLs. ### Testing - 96 focused FE unit tests and 211 Iceberg/Parquet BE ASAN unit tests passed. - The UNION regression failed on the previous implementation and passed with this fix. - Compiled the Groovy suite and checked 46 MAP expectations through the FE expression analyzer. - Passed Checkstyle and changed-line Clang checks. ### Release note Iceberg preserves opaque bytes in BINARY columns with spatially annotated Parquet files. Spatial NULL normalization preserves a consistent UNION schema. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: the external Iceberg suite was not run end to end. ### AI Disclosure - Tool: OpenAI Codex - Generated: Code, tests and commit message - Human review: Pending
|
/review |
There was a problem hiding this comment.
Reviewed head b58b2e216984bfee7ae1c7e4f0ffafcff31e6df3 statically. One new P2 finding concerns opaque BINARY equality-delete inputs; see the inline comment. No outstanding in-scope existing P0/P1 finding was independently confirmed.
Critical checkpoint conclusions:
- Goal and correctness: traced Iceberg schema → FE spatial identity/admission → Thrift → BE WKB columns/Parquet → GIS or MySQL/Iceberg output. The intended read/write feature is implemented broadly; the separate equality-delete consumer still has the inline defect.
- Scope and clarity: the change is broad because it introduces types across the full pipeline. Shared binary serialization/SerDe avoids duplicating the carrier, although NULL normalization and raw/S2 certification remain complex.
- Concurrency and locks: no new production thread, lock order or mutable global lifecycle was introduced in the reviewed paths. DDL validation retains the SDK's commit/CAS mechanism; test counters are thread-local.
- Lifecycle/static initialization: column/state ownership, arena trimming, split-local schema mutation and failed-writer close-before-delete were inspected. No additional ownership or cross-translation-unit initialization defect was verified.
- Configuration: no new runtime setting requires dynamic propagation.
- Compatibility: VARBINARY's block layout is retained; connector API 31 rejects pre-spatial plugins. Spatial participants must support these types; mixed 4.x/5.0 spatial execution/downgrade is the existing explicit scope decision.
- Thrift/protobuf: compared every touched definition against live master and branch-3.1/4.0/4.1/4.2 refs. New fields are optional and new enum values avoid the release FILE identities. No new collision was found.
- Parallel paths: checked legacy STRING versus typed GIS, annotated/unannotated and explicit BINARY files, nested containers, hidden/deleted keys, NULL/const, aggregate/state/window and DML paths. Standalone tombstone decoding needs the same table-aware BINARY handling as data decoding. The concrete Parquet downcast also conflicts with the documented neutral reader/mapping boundary; place shared materialization policy at that boundary.
- Conditional checks/errors: unsupported dimensions, metadata, shapes and operation families fail explicitly; typed storage and ST_AsBinary retain raw bytes. No additional reachable silent-continuation issue was verified.
- Test coverage: inspected added BE/FE tests and regression cases for identity, required lists, coercion, NULLs, byte round trips, GIS precision and failure cleanup. Opaque annotated BINARY tombstones/hidden keys lack the coverage described inline.
- Expected results: checked the changed regression outputs against their projections and assertions; the previous MAP-error and Z/M projection mismatches are repaired. Numerical results were reviewed against source logic, without executing Doris.
- Observability: existing query statuses/profiles remain available; no new critical logging/metric omission was substantiated. Performance conclusions are source-based, with no benchmark claim.
- Persistence/failover: spatial parameters use the existing type transport/persistence mechanisms. Iceberg DDL validates SDK-observed commit candidates and retains existing conflict handling; unseen REST server rebases remain the documented limit.
- Writes/atomicity: existing Iceberg commit/rollback machinery is reused. Inspected the output-file failure/unwind changes and required-list writer rejection; no separate new atomicity defect was established.
- FE–BE propagation: kind, CRS and algorithm are carried recursively, MySQL metadata is binary, and spatial remote constant folding remains excluded because FE cannot decode those values.
- Performance: reviewed column copying/erasure, reusable materialization and GIS work-count guards. Nullable V2 batching and general dense-Polygon/circle limits are already discussed follow-ups and are not duplicated.
- Other concerns/user focus: no additional user focus was supplied. The existing UNION NULL-provenance concern remains reachable under a direct LIMIT/SORT wrapper; it is deduplicated, not posted again. The latest branch common-type repair is present. Other confirmed repaired/disproved P1 threads are not carried as blockers.
Review convergence is assessed separately from feature correctness and runtime validation. This review ran no build, test, benchmark, cluster, source edit or submodule initialization; author-reported runs are not treated as execution by this review.
Review converged after 2 round(s).
### Background An Iceberg BINARY column can reference Parquet files with spatial annotations. Equality deletes read their key values independently of the data projection. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (follow-up) PR Type: Bugfix Problem Summary: Spatially annotated Parquet keys declared as Iceberg BINARY were validated as spatial values while reading equality-delete files or hidden data keys. Opaque WKB could fail the scan before the equality comparison. ### Details - **Frequency:** A Parquet equality-delete key declared BINARY carries a spatial annotation on the delete or data side. - **Root cause:** The raw-byte override was applied only to projected data columns, and table schema restoration favored the file spatial type over explicit BINARY. - **Why existing tests missed it:** The earlier opaque-byte test read a projected data column. Equality-delete tests used WKB accepted by the spatial decoder. - **Fix:** Resolve the key by Iceberg field identity before opening the Parquet reader and reuse the raw-byte materialization policy through the file-reader interface. - **Other paths and branches:** GEOMETRY and GEOGRAPHY keys keep spatial decoding. - **Behavior change:** Equality deletes compare opaque BINARY values as bytes and retain NULL-safe matching. ### Testing - Reproduced the WKB validation error with the new test on the previous implementation. - Passed 336 Iceberg, Parquet and TableReader BE ASAN tests with the fix. - Passed build hygiene, clang-format and changed-line Clang checks. ### Release note Iceberg equality deletes support BINARY keys stored in spatially annotated Parquet fields without parsing their bytes as spatial objects. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: OpenAI Codex - Generated: Code, regression test and commit message - Human review: Pending
|
/review |
|
Codex automated review failed and did not complete. Error: Step 'Resolve review inputs' ended with failure; inspect its logs for the original error. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
|
/review |
There was a problem hiding this comment.
Static review of PR 69032 at exact head b58b2e2.
Verified finding:
- F1 [P1] MapAggregateFunction's new legality check rejects only direct spatial MAP keys. Nested keys such as ARRAY, MAP<INT,GEOGRAPHY>, and STRUCTshape:GEOGRAPHY can reach the BE map combinator, where dispatch_switch_all has no complex-key case and DORIS_CHECK aborts instead of returning an analysis error. This affects count_map, sum_map, avg_map, min_map, and max_map. The finding is inline at the exact changed guard.
Review checkpoints:
- The feature goal is native Iceberg V3 GEOMETRY/GEOGRAPHY mapping, Parquet read/write, metadata preservation, and supported typed functions. The inspected FE, BE, v1/v2 Parquet, Iceberg, connector, and protocol paths implement that goal except for F1.
- The change is broad but internally separated into type/column, parser/calculation, connector validation, and Parquet/Iceberg layers. No new concurrency primitive was introduced; writer close and reader lifecycle paths were inspected.
- Spatial metadata is carried through FE/BE descriptors and Parquet schema conversion. Protocol IDs reserve branch-4.1 FILE identities and new metadata fields are optional. Existing P1 review finding 4430686953 remains applicable because mixed-version Thrift execution is explicitly outside this PR's compatibility scope.
- Parallel v1/v2 readers, raw BINARY overlays, nested LIST/MAP/STRUCT mappings, equality-delete handling, cache-key flags, and writer CRS preflight were checked. Existing annotated-BINARY/equality-delete discussions were treated as known context and not duplicated.
- Column ownership, arena compaction, nullable handling, WKB validation, error propagation, and aggregate/function dispatch were inspected. F1 is the remaining newly verified dispatch gap.
- Tests and generated outputs were inspected as static evidence only. No build, test, benchmark, or runtime validation was executed in this review.
- No additional user review focus was supplied. Existing current-head P2 discussions 4545596368 and 4551380707 remain known context and are not duplicated.
The review converged in round 1: all assigned specialist scopes completed, two returned NO_NEW_VALUABLE_FINDINGS, and the remaining candidate was independently verified and accepted.
Review converged after 1 round(s).
Existing P0/P1 findings confirmed for this head: #69032 (comment)
### Background The MAP aggregate functions validate their key types before coercion and again after rewriting. Aggregate states and combinators share that validation. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (follow-up) PR Type: Bugfix Problem Summary: The spatial MAP key guard missed spatial types inside ARRAY, MAP and STRUCT keys. The planner could accept a key type that the execution path cannot use. ### Details - **Frequency:** A MAP aggregate or state uses a key with a nested GEOMETRY or GEOGRAPHY leaf. - **Root cause:** The legality check tested only the outer key type. - **Why existing tests missed it:** The MAP aggregate key tests only covered direct spatial keys. - **Fix:** Reuse the recursive spatial type check on the MAP key and extend the existing aggregate, state and combinator cases. - **Other paths and branches:** Value and DISTINCT rules continue to apply independently. - **Behavior change:** The planner rejects nested spatial MAP keys with the existing spatial-key analysis error. ### Testing - Confirmed the new FE check assertion fails on the previous implementation. - Ran SpatialAggregateLegalityTest, SpatialPredicateLegalityTest and MapLambdaFunctionsTest. - Passed Checkstyle and git diff --check. ### Release note MAP aggregate functions reject keys that contain nested spatial values during analysis. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: OpenAI Codex - Generated: Code, test updates and commit message - Human review: Pending
|
/review |
There was a problem hiding this comment.
One new P2 correctness finding: the spatial BINARY override can undo a timestamp sibling rewrite in nested Iceberg equality-delete files, causing an otherwise valid scan to fail. It is distinct from the earlier missing-BINARY-override thread. The inline comment contains the trigger and fix direction.
Static coverage: all 234 changed paths (149 FE/regression, 70 BE I/O/type/protocol, 15 GIS), complete changed test bodies and regression results, plus an independent risk review. No additional user-provided focus was supplied.
Critical checkpoint conclusions:
- Goal and proof: native spatial identity/WKB, Iceberg v3 Parquet I/O and deliberately bounded Geography calculations are wired end to end; the reported delete-reader interaction remains incorrect. Relevant positive/negative tests are present and were inspected.
- Scope and reuse: the large change follows one type feature through its consumers; shared binary serialization, validation and schema helpers reuse existing mechanisms.
- Concurrency and locks: no new worker or lock order found. DDL candidate validation retains existing Iceberg CAS/retry behavior; reader overrides are split-local and separate from cached metadata.
- Lifecycle: column/aggregate payloads own their bytes; window erasure reclaims dead arenas. Writer failure cleanup closes/destroys upload owners before deletion. No new cross-TU initialization dependency found.
- Configuration: no new runtime setting; existing timestamp mapping is the reported trigger. SQL-mode rendering and internal byte-mode cache identity were checked.
- Compatibility: legacy STRING GIS and ordinary VARBINARY behavior remain separate; the VARBINARY Block layout is unchanged. Connector API31 and its version gate/baseline agree. Mixed 4.x/5.0 spatial execution and downgrade remain explicitly unsupported under the existing maintainer scope decision; this review does not certify them.
- Thrift/protobuf: all touched definitions compared with branch-3.1/4.0/4.1/4.2 and master refs. Spatial enums avoid FILE's existing IDs; new metadata fields are optional and no new collision was found.
- Parallel consumers: checked typed/legacy, scalar/nested, plain/dictionary, NULL/constant, projected/hidden delete keys, constructors/aggregates/state/combinators, INSERT/UPDATE/MERGE/changelog, and data/delete-only writers. The combined BINARY/timestamp tombstone case is the verified omission.
- Conditions: metadata/format/dimension/EMPTY restrictions and NULL-provenance checks have concrete paths and negative controls. Ordinary sibling casts, input scope, ExprIds, UNION common types and selected MERGE-branch evaluation were traced.
- Tests: inspected unit, actual-file and external regression coverage. Missing combined nested BINARY/timestamptz delete-key coverage is requested inline.
- Results: changed golden rows match query/fixture shapes on inspection; no additional result mismatch found. Generation provenance and runtime numeric results were not verified.
- Observability: unsupported operations/WKB failures retain analysis or Status context; cleanup logs identify files. No new per-row INFO logging or concrete additional metric defect found.
- Persistence and failover: CRS/algorithm use existing type persistence and descriptor paths. No new EditLog, visible-version or MoW logic; Iceberg retains existing metadata commit ownership.
- Writes and failure atomicity: full-schema admission and pre-file CRS validation were checked, along with existing commit/rollback and failed-open cleanup. No separate new partial-commit, leak or deadlock found.
- FE/BE transport: scalar/column Thrift, protobuf and connector copies retain spatial parameters. Constant folding excludes unsupported spatial PValues; MySQL and typed ST_AsBinary use binary carriers.
- Performance: reviewed owned filtering/erasure, partial TopN, raw-coordinate calculations and indexed admission. Already-reported nullable V2 batching and general dense-polygon/long-arc work remain known limits and are not reposted; no universal linear bound or benchmark result is claimed.
- Final challenge and prior reviews: rechecked candidates, callers, alternate paths and anchors. Historical P1 COUNT, FILE IDs, Apple ARM arithmetic, dimensional validation, ORC and nested MAP keys are repaired; bearing, polygon-interior distance and identity-partition allegations are contradicted by current code/library contracts and tests. No in-scope existing P0/P1 remains independently confirmed; the mixed-version scope exception is stated above.
Validation was static inspection only. No builds, tests, benchmarks, cluster execution, source changes or submodule initialization were performed. Runtime/platform/ASAN/external interoperability validation remains unverified.
Review converged after 2 round(s).
### Background Iceberg equality-delete readers can apply timestamp semantics and raw BINARY overrides to different leaves of one nested Parquet STRUCT. ### What problem does this PR solve? Issue Number: None Related PR: apache#69032 (follow-up) PR Type: Bugfix Problem Summary: Synchronizing an annotated BINARY leaf rebuilt its parent STRUCT from the native footer and restored a timestamp sibling to DATETIMEV2. The file block then disagreed with the reader output when timestamp mapping was disabled. ### Details - **Frequency:** A nested equality-delete key combines an annotated BINARY leaf with a TIMESTAMPTZ sibling. - **Root cause:** The raw-byte override rebuilt the native parent from stale child types. - **Why existing tests missed it:** BINARY and timestamp equality-delete tests covered separate nested paths. - **Fix:** Synchronize the current split-local child types into the native schema before rebuilding the parent. - **Other paths and branches:** Existing timestamp and spatial decoding rules remain in place. ### Testing - Ran 213 targeted Iceberg and Parquet BE ASAN tests. - Added a regression for nested BINARY plus TIMESTAMPTZ schema synchronization. - Passed changed-file Clang checks, build hygiene, clang-format and git diff --check. ### Release note Nested Iceberg equality-delete schemas preserve timestamp siblings when a spatially annotated BINARY key is read as raw bytes. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: OpenAI Codex - Generated: Code, regression test and commit message - Human review: Pending
|
/review |
|
run buildall |
There was a problem hiding this comment.
Review of PR #69032 at 4d7ce45ce69a02ab2ff547496eac9dfc505a7522: no new actionable finding was verified in the supported feature scope. No additional user review focus was supplied. Existing findings were not reposted.
Static review covered all 234 paths in the supplied aggregate diff: 82 BE, 143 FE, three shared protocol definitions and six regression SQL/output files. Frontend/backend complete reviews and a separate risk review examined related invocation chains and tests. No builds, tests, benchmarks, source edits or submodule initialization were performed. Author-reported test passes were treated as prior reports, not validation executed by this review.
Critical checkpoint conclusions:
- Goal and proof: spatial kind/CRS/algorithm and raw WKB are carried through Iceberg mapping, Parquet I/O and typed execution. Positive/negative tests were inspected; source inspection does not establish a current-head runtime pass.
- Scope and reuse: the broad change follows the necessary type, connector, planner, reader/writer and function boundaries. Binary payload transfer is shared while spatial validation remains separate. No additional scope/refactoring defect identified.
- Concurrency and locks: function scratch, normalization state and semantic reader trees are query/split owned; cached footer metadata stays immutable and cache keys include annotation interpretation. Iceberg DDL validates the SDK-observed commit candidate across retries. No new thread-entry, lock-order or heavy-under-lock defect identified.
- Lifecycle and initialization: column copies and aggregate states own WKB; mutable filtering preserves arena ownership and erasure reclaims discarded storage. Writer error cleanup closes pending uploads before deletion. Wide arithmetic has a portable fallback for narrow long double. No additional ownership/static-initialization defect identified.
- Configuration: no new runtime configuration or dynamic-update obligation.
- Compatibility and API/storage changes: existing VARBINARY block layout is retained; connector API is deliberately bumped to 31.0, with current31/prior30 probes aligned. Participating nodes must support spatial types. Mixed 4.x/5.0 spatial execution is an explicit maintainer-approved scope exclusion (decision, existing disposition); it is not reposted or counted as an in-scope P1.
- Thrift/protobuf IDs: complete touched definitions were compared with current live-matching branch-3.1, branch-4.0, branch-4.1 and branch-4.2 definitions. New metadata fields are optional; spatial enum allocations avoid branch-4.1 FILE's protobuf45/Thrift47 identities. No new collision or ID reuse found.
- Parallel paths: scalar/nested, plain/dictionary, nullable/constant, data/equality-delete, typed/opaque-BINARY and insert/update/merge paths were inspected. ORC spatial paths explicitly reject before invalid casts; Hive/load BINARY consumers retain opaque bytes. Sort/spill and position-delete writer entry points were also traced.
- Conditional and error behavior: unsupported metadata, dimensions, kernels and unresolved calculation ambiguity have explicit rejection paths. Actual NULL required container values are rejected recursively by VIcebergTableWriter::_write_prepared_block -> iceberg::validate_write_block before partition dispatch or Arrow conversion; optional parent NULLs correctly mask children. No reachable required-container write defect remains.
- Test coverage: inspected unit/regression additions cover transport, ownership, NULLs, complex schemas, dimensions, negative admission, BINARY overrides, equality deletes, numerical cases and work counts. Existing runtime write-validator tests also cover required elements/children and rejection before writer creation. Runtime/platform/cross-writer execution remains unverified here.
- Expected results: changed regression SQL and generated output sections were statically compared for shape, row counts and expectations, including corrected Z/M projections. No additional mismatch was substantiated. Current-head output generation and independently computed numerical truth for every spherical fixture were not verified by execution.
- Observability: errors retain type/row/file context at existing boundaries and reader profile paths remain intact; no new high-volume INFO logging defect identified. Work-count hooks are present, but logs, metrics and performance counters were not measured.
- Persistence and failover: spatial parameters use the existing catalog/schema/type serialization paths. Internal spatial storage is rejected; no internal rowset, visible-version, delete-bitmap or EditLog transaction protocol changes. Iceberg metadata commit/retry and cleanup retain their existing ownership.
- Writes and atomicity: data-file writes use the pinned target schema and existing commit/rollback lifecycle. Recursive target-schema value validation precedes all production partition-writer routes; sorted/spilled data has already passed that validation. The direct alternate Parquet-writer consumer is restricted to fixed position-delete fields. No new write-atomicity or value-loss defect identified.
- FE/BE transport: connector/catalog types, Thrift, PTypeDesc, PColumnMeta, MySQL binary metadata and recursive spatial constant-fold exclusion were inspected. Direct Flight spatial schemas remain unsupported as documented; text/binary projections are the supported client route.
- Performance and memory: in-place filtering, periodic arena compaction, byte-oriented WKB parsing and indexed/grouped noding address earlier redundant work. Query-owned CTE memoization avoids repeated producer expansion. Nullable-selection batching and general dense-polygon optimization remain known existing discussion limits; no new distinct performance defect or benchmark claim.
- Additional risks and prior findings: current timestamp-sibling/BINARY overrides synchronize split-local sibling types before rebuilding parents; UNION normalization reconciles branch types and preserves output identities; recursive spatial MAP-key rejection and API31 wiring are present. Earlier in-scope P1 reports are fixed or excluded by current source/dependency guards. No existing in-scope blocking comment ID remains to carry forward, and no concrete candidate or initial risk item remains unresolved.
The conclusion is bounded to static inspection of this head. Runtime/interoperability, exhaustive numerical-oracle and benchmark validation remain limits of this review, not claims of completed execution.
Review converged after 3 round(s).
Background
Iceberg V3 defines GEOMETRY and GEOGRAPHY with a coordinate reference system (CRS); GEOGRAPHY also identifies its edge algorithm. Their Parquet representation carries WKB bytes and spatial annotations. Doris needs to preserve that identity through catalog mapping, query execution and writeback, while keeping its existing STRING-based spatial functions compatible.
What problem does this PR solve?
Issue Number: N/A
Related PR: #67907
PR Type: Feature
Problem Summary:
Users need to query and write Iceberg V3 spatial columns without losing their CRS, edge algorithm or original WKB. Add native spatial types, recursive Parquet read/write and typed spatial functions. This requires consistent type transport, write validation before coercion, and explicit rejection of operations that lack spatial implementations. About 65% of added lines are tests and generated results; existing STRING spatial functions retain their behavior.
Details
Change map: 216 files, +22,246/-593: production +7,679/-561; tests +13,680/-31; generated regression output +886/-0; build +1/-1. User documentation is in the separate website PR. Read the production changes in these parts:
ColumnSpatialand the shared binary SerDe.ConnectorSpatialWriteNormalizerandConnectorSpatialWriteValidator.functions_geo.cpp,wkb_parse.cppandgeography_calculation.cpp.Scope: Read/write top-level spatial columns, ARRAY elements, ordinary-key MAP values and STRUCT fields through Parquet. Preserve all seven basic ISO WKB kinds in XY/XYZ/XYM/XYZM, NULL/EMPTY and original bytes.
ST_AsBinarypreserves Z/M; typed text access and calculations reject non-XY inputs. Geography measurements and relations support defaultOGC:CRS84/sphericalnonempty XY Point/LineString/Polygon, including typedST_Equals,ST_OverlapsandST_DWithin. Unsupported shapes/metadata and unresolved conversion-precision cases fail explicitly.Spatial Variant values, ORC materialization, native spatial GROUP BY/DISTINCT/set-operation keys, window partition keys and unsupported aggregate combinations are rejected. Preserve UNION ALL, supported spatial value aggregates/windows and ordinary-key/spatial-value operations. Paimon/Lance/GeoArrow, internal spatial storage, indexes, pruning, predicate pushdown, CRS conversion, typed WKT input and additional Geography algorithms remain outside scope.
Design: Keep kind/CRS/algorithm in typed metadata because a generic binary or STRING carrier cannot identify them. Raw WKB is canonical so storage round trips retain the input bytes. Binary and spatial Parquet consumers share byte transfer; spatial validation stays in the spatial SerDe. FE write normalization retains ordinary keys/siblings and requiredness before coercion. Spherical predicates use original-coordinate checks to reject unresolved S2 boundary-rounding ambiguity. Scope decisions are recorded in this PR's review discussion; no separate design issue is linked.
Usage: The typed constructor accepts hexadecimal WKB. For example, create a Point at (1, 2):
For an imported Iceberg spatial column, use
ST_AsText(geom)orhex(ST_AsBinary(geom))to inspect it; matching target schemas support INSERT SELECT while preserving spatial identity.Default behavior: No new runtime flag is introduced. Eligible Iceberg fields map to native spatial types automatically. Spatial writes require Iceberg V3 and Parquet, with an explicit connector capability for nested leaves. Nondefault CRS/algorithm metadata is retained without conversion; property-referenced
projjson:writes are rejected before file creation.Compatibility: Participating FEs/BEs must support the new types; mixed 4.x/5.0 execution and downgrade support for spatial metadata are outside scope. Connector plugins must match API 31.0, distinct from upstream API 30.0. Existing VARBINARY Block layout and STRING constructors remain unchanged. Typed MySQL values use binary metadata; generic Flight clients need text/binary projections because direct spatial Flight schemas are unsupported. Retain the BE constant-folding exclusion because FE cannot decode spatial PValues.
Behavior change: Iceberg spatial fields are exposed as native types with binary MySQL results. Connector plugins must be rebuilt for API 31.0, including plugins that only expose ordinary columns.
Persistence and failure handling: Preserve spatial parameters in schema/type transport and Parquet annotations. Validate spatial identity and supported schemas before coercion or file creation. Reuse Iceberg's existing commit/conflict and cleanup lifecycle; DDL preflight checks SDK-observed schemas, without claiming a server-wide invariant for REST rebases the client cannot observe.
Follow-up plan: Nullable V2 batching and general dense-Polygon optimization remain deferred.
Testing
d89b8a795bc: 337 FE tests passed, including the complete Connector SPI suite and selected Iceberg mapping/DDL/write-plan tests.e993d2e9d03andc3c75caa110: 45 binary/spatial SerDe BE ASAN tests and 74 FE validator/normalizer/converter tests passed. These cover explicit ORC rejection and nested required-list NULL handling.8a774c249e29: 360 FE tests, 132 Geography BE tests, and the GIS/Iceberg suites passed locally, with 70 GIS and 131 Iceberg result sections. These results predate subsequent changes.e27809effd8, selected BE tests did not execute: local Lance/Rust dependency setup blocked the build. The new BSON-isolation regression and latest required-list external SQL cases remain unexecuted locally. The external suite requiresenableIcebergTestand working Spark/MinIO fixtures. Latest-head full community CI has not been verified here; earlier passes are not a current-head CI verdict.Notes for Reviewers
Release note
Support native Iceberg V3 GEOMETRY/GEOGRAPHY schema mapping and Parquet read/write, including ARRAY elements, ordinary-key MAP values and STRUCT fields. Preserve CRS, edge algorithm and raw ISO WKB including Z/M, with explicit XY calculation limits and unsupported-operation errors. Connector plugins must match API 31.0.
Check List (For Author)
AI Disclosure