You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b58b2e2
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](iceberg) Reconcile spatial union writes and preserve binary reads
### 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: #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
0 commit comments