Avatar for the vortex-data user
vortex-data
vortex
BlogDocsChangelog

Performance History

Latest Results

feat(expr): fold cast of a literal to a literal in Cast simplify Implement Cast::simplify_untyped so cast(lit(x) as T) folds to lit(x cast to T) at plan time. A failing scalar cast (e.g. null to a non-nullable dtype) leaves the expression unchanged so the error still surfaces at execution time. Prune rules pattern-match bare Literal nodes and silently decline cast-wrapped ones, so filters pushed with a cast around the literal (e.g. DuckDB decimal literals bound as cast(dec as f64)) scan every chunk. Since ScanBuilder already runs optimize_recursive on every pushed filter, this one fold fixes all producers at once. Signed-off-by: Nemo Yu <zyu379@wisc.edu>
nemo/fold-cast-of-literal
19 minutes ago
fix(vortex-row): decimal sort keys are not memcmp-comparable across chunks (#8937) ## The bug `ORDER BY` / top-k on a decimal column silently returns wrongly ordered rows whenever the column spans chunks whose physical value widths differ. No error is raised; the output looks plausible. ### Example Take a `DECIMAL(7, 5)` tip column and `ORDER BY tip DESC`. Two rows land in different chunks, and compression picks a different physical width for each chunk: | row | unscaled value | chunk's physical type | |---|---|---| | `tip = 0.00484` | `484` | **i16** (484 doesn't fit i8) | | `tip = 0.00091` | `91` | **i8** (every value in its chunk fits i8) | A descending sort key is built per chunk: write the value big-endian, flip the sign bit, invert the value bytes (for DESC), and prefix the non-null sentinel `0xFE`. Before this fix, the number of value bytes came from the *chunk's* type: ``` tip = 0.00484, encoded at its chunk's width (i16 โ†’ 2 value bytes) big-endian bytes 01 E4 flip sign bit 81 E4 invert for DESC 7E 1B prepend sentinel FE 7E 1B โ† 3-byte key tip = 0.00091, encoded at its chunk's width (i8 โ†’ 1 value byte) big-endian bytes 5B flip sign bit DB invert for DESC 24 prepend sentinel FE 24 โ† 2-byte key ``` The sorter compares keys with `memcmp`: ``` key(0.00484) = FE 7E 1B key(0.00091) = FE 24 โ”€โ”ฌ โ”€โ”ฌ โ”‚ โ””โ”€ byte 1 decides: 0x24 < 0x7E, so key(0.00091) is the smaller key โ””โ”€ byte 0: equal ``` But byte 1 means different things in the two keys: in the 3-byte key it is the *high-order* byte of a two-byte number, while in the 2-byte key it is the *only* byte of a one-byte number. The comparison is meaningless โ€” and DESC encoding promises **bigger value โ‡’ smaller key**, so the smaller key wins: the sorter ranks `0.00091` as a larger tip than `0.00484`. Ascending breaks symmetrically. With this fix, both chunks encode at the width the *declared* dtype implies (`DECIMAL(7,5)` โ†’ i32 โ†’ 4 value bytes), whatever their physical storage: ``` key(0.00484) = FE 7F FF FE 1B key(0.00091) = FE 7F FF FF A4 โ”€โ”ฌ โ””โ”€ byte 3 decides: 0xFE < 0xFF, so key(0.00484) is smaller ``` Equal-length keys, every byte position aligned โ€” `0.00484` correctly sorts first in the descending order. ## The fix Derive the key width from the declared dtype, so every chunk of a column encodes identical-length keys: - `decimal_key_type` (vortex-row): the dtype-derived width, used by both the sizing pass and the encode dispatch. - `converted_buffer<W>` (vortex-array, next to `widened_buffer`): returns a chunk's values at exactly width `W`. Zero-copy when the chunk is already stored at `W` (the common case), lossless widening otherwise, and an error for any value that violates its declared precision, such values previously encoded a garbage key silently. The encode loop itself is unchanged; only where it reads its values from changed. --------- Signed-off-by: Nemo Yu <zyu379@wisc.edu> Co-authored-by: Robert Kruszewski <github@robertk.io>
develop
3 hours ago

Latest Branches

CodSpeed Performance Gauge
0%
feat(expr): fold cast of a literal to a literal in Cast simplify#8962
21 minutes ago
45a9e16
nemo/fold-cast-of-literal
CodSpeed Performance Gauge
0%
CodSpeed Performance Gauge
0%
53 minutes ago
3baffd0
rk/onpairgpu
ยฉ 2026 CodSpeed Technology
Home Terms Privacy Docs