Implement DuckDB-based converter - #198
ivorbosloper wants to merge 19 commits into
Conversation
|
You can set KV_METADATA in DuckDB? That's awesome and resolves the primary issue we had on our list! Will test later, thanks! Maybe it makes sense to jump on a call for the metadata discussion. |
Yes. I first tried the python API, but that doesn't expose the Metadata option. Would be great to have a call on the metadata details, you wrote the vecorel-parquet logic and seem well informed... |
|
I'm still stuck on fiboa validation: As I understand it, the validator takes the parquet schema and checks it with the fiboa schema (see implementation ). The fiboa schema is built from the extensions (and is correct in this case), but the parquet schema is implicitly created by duckdb (with Can I force this to a 'non-null' result? I've tried Casting with Maybe related to duckdb/duckdb#13949 |
|
I think duckdb parquet writer doesn't support setting the nullability derived from the resultset. same for |
|
For me that sounds like a bug in duckdb. Is there an open issue for it, otherwise maybe open one? |
Is "Non-nullability" a property of a query result column? Maybe this information is lost. But at least it's a feature request.. |
3f0dd95 to
c524142
Compare
|
@ivorbosloper In which state is this PR? Was the collection-level metadata and column schema ever solved? Is this generating valid fiboa/vecorel files? |
Co-authored-by: Matthias Mohr <matthias@mohr.ws>
b84a71d to
0cd5982
Compare
0cd5982 to
c19eb37
Compare
|
Updated PR to work with new duckdb implementation in vecorel-cli, needs a release of vecorel-cli first. |
The new vecorel-cli fails when a required property (here crop:code) has no values. LT 2024 ships an empty crop_code column next to a populated crop_name, so the name is the best available code. Reading v1.3 of the inventory also adds the 2025 edition. Ported from Ivor's publish-portolan branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Superseded. The converter now lands in two places: |
Adds a DuckDB-based converter for datasets that are too large for the GeoDataFrame-based codepath. The dataset with the largest dataframe (Japan) no longer needs a 128GB+ machine; it converts on a laptop, bounded by DuckDB's external processing, and runs in well under 30 minutes.
The implementation has moved to vecorel-cli (
DuckDBBaseConverter,GeoParquet.postprocess(), Hilbert helpers); this PR keeps only the thin fiboa subclass and the jp dataset using it. The outputs of the two codepaths are comparable by construction — same schema, data types, nullability, row order (CRS-derived Hilbert grid with stable tie-breaking), collection and GeoParquet metadata (incl. CRS), and file packaging — verified bytests/test_convert_parity.py, which converts jp through both codepaths and compares the results.pixi updateto refreshpixi.lock— CI stays red until then.Also drops the redundant
sourcesfrom the HR converter, which vecorel-cli 0.2.18 rejects becausesourcessilently overrides thevariants.🤖 Generated with Claude Code