Skip to content

CX-39170: Arrow-rs v57.0.0-cx.0 - #83

Closed
avantgardnerio wants to merge 6 commits into
base-57from
brent/arrow57
Closed

CX-39170: Arrow-rs v57.0.0-cx.0#83
avantgardnerio wants to merge 6 commits into
base-57from
brent/arrow57

Conversation

@avantgardnerio

@avantgardnerio avantgardnerio commented Apr 28, 2026

Copy link
Copy Markdown

CX-39170

Description

Rebase Coralogix patches from v56.0.0-cx.0 onto upstream Arrow 57.0.0.

Patches to cherry-pick:

Checklist

  • All patches cherry-picked
  • Tests pass with rust 1.90
  • Tag v57.0.0-cx.0 created

Adds with_predicate_coop() to ReadPlanBuilder, an async version of
with_predicate() that cooperatively yields after decoding 2MB of data,
preventing long predicate evaluations from blocking the async runtime.

Co-Authored-By: Dan Harris <dan@coralogix.com>
…he#8715 v57)

Adds RowId support to ParquetRecordBatchReader and the async stream
builder. When enabled via with_row_id(), a UInt64 column is prepended
to each RecordBatch containing the file-level row offset for each row.

Co-Authored-By: Thomas Peiselt <pi@kulturguerilla.org>
joroKr21 and others added 3 commits April 29, 2026 05:34
## Summary

- Fix `MutableArrayData::extend_nulls` which previously panicked
unconditionally for both sparse and dense Union arrays
- For sparse unions: append the first type_id and extend nulls in all
children
- For dense unions: append the first type_id, compute offsets into the
first child, and extend nulls in that child only

## Background

This bug was discovered via DataFusion. `CaseExpr` uses
`MutableArrayData` via `scatter()` to build result arrays. When a `CASE`
expression returns a Union type (e.g., from `json_get` which returns a
JSON union) and there are rows where no `WHEN` branch matches (implicit
`ELSE NULL`), `scatter` calls `extend_nulls` which panics with "cannot
call extend_nulls on UnionArray as cannot infer type".

Any query like:
```sql
SELECT CASE WHEN condition THEN returns_union(col, 'key') END FROM table
```
would panic if `condition` is false for any row.

## Root Cause

The `extend_nulls` implementation for Union arrays unconditionally
panicked because it claimed it "cannot infer type". However, the Union's
field definitions (child types and type IDs) are available in the
`MutableArrayData`'s data type — there's enough information to produce
valid null entries by picking the first declared type_id.

## Test plan

- [x] Added test for sparse union `extend_nulls`
- [x] Added test for dense union `extend_nulls`
- [x] Existing `test_union_dense` continues to pass
- [x] All `array_transform` tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
@avantgardnerio
avantgardnerio force-pushed the brent/arrow57 branch 4 times, most recently from b14a2d1 to 7d5c1c9 Compare May 5, 2026 20:01
@avantgardnerio
avantgardnerio deleted the brent/arrow57 branch May 12, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants