github teaguesterling/plinking_duck v0.18.1

one hour ago

This release fixes two wrong results: plink_pca under threads, and a region := read with a non-ASCII or backslash contig. A region read over a .pvar.parquet also opens the file fewer times. No breaking change. It builds for DuckDB v2.0.1.

FIX — plink_pca could return 0 rows or wrong eigenvalues, with no error (#155)
Under threads > 1, a thread that joined a pass late could scan with
the previous pass's offset. The pass was then never merged (0 rows)
or merged with misplaced partials (wrong eigenvalues). One atomic now
holds the pass number and the thread count, so the last thread out
of a pass always merges it. Under CPU contention, main failed 38 of
320 and 22 of 320 runs on two machines; this release failed 0 of 320
on each. Related: #60, #75.

FASTER — samples := by name in plink_freq and plink_hardy (#153, #154)
A by-name samples := list resolves in one pass over the IIDs. With a
.psam.parquet companion, only the named rows are read. Results do
not change.

CHANGED — error text for a bad Parquet companion (#156)
A Parquet companion that fails to open (bad magic, truncated, empty,
no permission, missing) now gives:
IO Error: : failed to read parquet companion '': ...
Before, DuckDB's own error came through unwrapped. Query results do
not change.

FASTER — a region read over a .pvar.parquet opens it once per query (#127)
read_pfile(..., region := ...) over a Parquet .pvar companion made by
the writer opens the file 3 times, not 5: the same as one plain
filtered read_parquet. On a remote file set each open is a round
trip. A #CHROM companion, or one with no __vidx, reads as before.
A converted companion with both #CHROM and CHROM and a __vidx is
now filtered on CHROM.

FIX — region := with a non-ASCII or backslash contig (#127)
v0.18.0 passed the region value to the .pvar.parquet query as a BLOB.
- A region read raised "Conversion Error: Invalid byte encountered
in STRING -> BLOB conversion" when it scanned a row whose contig
has a non-ASCII or backslash character (for example region := '1'
on a file with one 'é' contig).
- A non-ASCII or backslash region value raised the same error.
- region := '\x41' returned the rows of contig A.
The value is now passed as text: these reads return the right rows.

BUILD — compiles against DuckDB main (v2.1.0-dev) as well as v2.0.1 (#156)

Tests: 159 test cases pass on linux_amd64 and osx_arm64 (DuckDB v2.0.1) and on linux_amd64, linux_arm64 and osx_arm64 (DuckDB v2.0), at the first attempt (main run 45891110427). linux_arm64 on v2.0.1 is built, not tested.

Don't miss a new plinking_duck release

NewReleases is sending notifications on new releases.