Skip to content

Reimplement vec merge - #55

Open
ivorbosloper wants to merge 6 commits into
mainfrom
merge-parquet-hydrate
Open

ivorbosloper wants to merge 6 commits into
mainfrom
merge-parquet-hydrate

Conversation

@ivorbosloper

Copy link
Copy Markdown
Collaborator

merge_parquet dropped a property that each part kept as a constant in its collection when the parts disagreed on it: it was neither a column nor in the merged collection. Now it becomes a column again, with each part's value, as vec merge does by reading with hydrate=True. Found in fiboa/cli#338, where the Spanish province code disappeared from the merged file.

  • Only what the merged collection does not carry is hydrated; a constant all parts share stays in the collection. Collection-only properties (title, license, ...) are never hydrated.
  • A part that lacks the property gets NULL; a part that already has it as a column keeps its column.
  • With something to hydrate, the source is one SELECT per part joined with UNION ALL BY NAME; otherwise the query is unchanged.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix merge gaps, merge with DuckDB in vec merge
* Merge: hydrate only what the parts disagree on (review #1)
* Merge: keep rows as they are with DuckDB, like in memory (review #2)
* Report constants that don't fit their schema type (review #3)
* Merge: reject two versions of one schema in a collection (review #4)
* DuckDB: key ids by collection only with several collections (review #5)
* Merge: apply excludes to the loaded data in memory (review #6)
* DuckDB: quote required property names with _sql_name (review #7)
* Share the CRS comparison of merge and DuckDB (review #8)
* Merge: warn when includes drop a required collection-only property (review #9)
* Merge: accept a collection that can't be determined (review #10)
* Add strict mode to vec merge, minor improvements and bug fixes (#60)

Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
Co-authored-by: Ivor <ivorbosloper@gmail.com>
@m-mohr m-mohr changed the title merge_parquet: hydrate the constants the parts disagree on Reimplement vec merge Sep 28, 2026
@m-mohr

m-mohr commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

This PR now also includes a large set of additional changes from PRs #56 #58 and #60.

@m-mohr
m-mohr requested a balanced review from Copilot September 28, 2026 11:54

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The in-memory engine still drops selected all-null columns, producing inconsistent schemas and violating non-strict behavior.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (2)

Comment thread vecorel_cli/vecorel/ops.py Outdated
Comment on lines +115 to +119
# Remove empty columns, except for the geometry, which is required
geometry = merged.geometry.name
merged = merged.drop(
columns=[c for c in merged.columns if c != geometry and merged[c].isna().all()]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants