Repository navigation
Read multi-file views by each file's struct-list layout; document DuckDB on relayouted files - #382
Conversation
…s their features fragment hashes fragment_id from feature_id. relayout renumbers the feature ids and rewrites fragment.feature_id, but kept the fragment footer's identity_source "derived", so `qpxc validate --check-identity` (and --conformance) reported every fragment id as stale and the dataset as invalid. The links themselves were intact. A view whose identity composite holds a reference relayout rewrites now states identity_source "provided", as merge() already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149aXmZfe47GqaXBnt9DAWK
…st layout A view over several files (dataset shards, an S3 glob, Hive partitions) took the qpx.struct_lists layout of one footer (LIMIT 1) and applied it to every row, and took a list<struct> type for a struct. A converted file next to a relayouted one made the view unreadable; relayouted files of different tools read the second file's rows under the first file's score names, with null values and no error, and qpxc validate crashed. The files of a view are now grouped by declared layout, the stored type of each struct leaf, and struct columns without a layout. One group is read as before with one read_parquet; several groups are read apart and unioned by name, each restored by its own layout. A struct without a layout next to other groups is refused, and a view that cannot be restored is dropped rather than left unrestored. Hive partitions are unioned by name, like shards. A single file reads only its own layout, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149aXmZfe47GqaXBnt9DAWK
Struct-list SQL and the footer query for higher_better, when a column becomes a struct, union_by_name for several files, ids that collide across relayouted datasets and change with their input, exact matches on rounded values, row order, and the DuckDB versions checked. Fix the relayout memory options in the transform guide and point the view pages to the struct form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149aXmZfe47GqaXBnt9DAWK
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 35 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…t of additional_scores
Follow-up to #376 and #377. It fixes one bug in qpx's reader and documents how relayouted files behave in DuckDB. The findings are summarised in #377.
Bug: a view over several files restored every row with one file's layout
restore_itemsreadqpx.struct_listsfrom one footer (parquet_kv_metadata … LIMIT 1) and applied it to the whole unioned view. It also took alist<struct>type (STRUCT(...)[]) for a struct. This affects dataset shards (register_parquet_files), S3 globs and Hive directories. Measured on real data:Datasetskipped the structure with a warning (Binder Error: … struct_extract(STRUCT(...)[] …), or queries failed later withConversionException.qpxc validatecrashed.Fix (
qpx/core/struct_lists.py,qpx/core/engine.py)layout_groupsgroups the files of a view by three things: the layouts their footers declare, the stored type of each struct leaf, and any struct-list columns held as structs without a layout. Without the type check, a FLOATcv_paramsterm read next to a DOUBLE one was widened, so52.822754read52.82275390625.read_parquetview as before.read_parquetper group, each restored by its own layout, thenUNION ALL BY NAME. Rows follow the groups rather than the file order.COPY) is refused with aValueErrorthat names the file. Previously it gave wrong values or a late error.union_by_name=true, like shards. Without it, a DOUBLE in a later partition was read as the first partition's FLOAT.startswith("STRUCT")check matched list types too.Docs
docs/spec/serialization.md:higher_better.union_by_name = truefor several files, and list and struct files can't be read in oneread_parquet.rtwent from 43,121 to 336 matches.Also:
transform.mdnamed--memory-limit/--temp-directory, which relayout doesn't have; it now names--duckdb-memory/--temp-dir.scores.mdlink to the struct form.Also in this branch
d197ecf: relayout states
identity_source=providedfor fragment, whose ids keep their values but were hashed from the oldfeature_id.783be8d (drop the scores a typed q-value column repeats) changes what the writers store, so it is reverted here and moved to #386. The struct-field example in
serialization.mdnow usesdiann_cscore, which is correct whichever of the two PRs merges first.Tests
tests/integration/test_struct_lists.py: converted + relayouted shards, different layouts (2 and 3 files), an S3-style glob, Hive partitions with different layouts, the same layout stored as different types,union_by_nameon Hive, the single-read path for one layout, no footer read for a plain file, only the declared layout read for one relayouted file,qpxc validatewithout a traceback, the refusal, and the view drop.pytest tests -n 8gives 2,788 passed on DuckDB 2.0.0 and 2,788 passed on DuckDB 1.5.0.ruff checkandruff format --checkare clean, andmkdocs buildpasses.DatasetCollectionis unchanged.Limits
glob()andparquet_kv_metadatause the same file list. If their names ever differed, registration fails with a clear error rather than reading wrong values.*or?is expanded as a glob, as before.Generated by Claude Code