-
Notifications
You must be signed in to change notification settings - Fork 381
refactor(arrow2): migrate ilike.rs to arrow-rs #5936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Replace daft_arrow::array::BooleanArray collection with Vec<Option<bool>> - Use BooleanArray::from((name, slice)) instead of arrow2 BooleanArray - Add comprehensive test coverage for ilike function: - Broadcast pattern matching - SQL LIKE wildcards (% and _) - Element-wise matching - Null handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Greptile SummaryThis PR successfully migrates Key changes:
Technical correctness: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant ilike_impl
participant parse_inputs
participant create_broadcasted_str_iter
participant compile_like_regex
participant BooleanArray
Caller->>ilike_impl: ilike_impl(arr, pattern)
ilike_impl->>parse_inputs: Validate inputs
parse_inputs-->>ilike_impl: (is_full_null, expected_size)
alt is_full_null
ilike_impl->>BooleanArray: full_null()
BooleanArray-->>Caller: Return null array
else expected_size == 0
ilike_impl->>BooleanArray: empty()
BooleanArray-->>Caller: Return empty array
else normal case
ilike_impl->>create_broadcasted_str_iter: Get self_iter
alt pattern.len() == 1 (broadcast)
ilike_impl->>compile_like_regex: Compile single pattern
compile_like_regex-->>ilike_impl: Regex
loop for each value
ilike_impl->>ilike_impl: Apply regex.is_match()
end
ilike_impl->>ilike_impl: collect() to Vec<Option<bool>>
else element-wise matching
loop for each (value, pattern) pair
alt pattern in cache
ilike_impl->>ilike_impl: Reuse cached regex
else pattern not in cache
ilike_impl->>compile_like_regex: Compile pattern
compile_like_regex-->>ilike_impl: Regex
ilike_impl->>ilike_impl: Cache regex
end
ilike_impl->>ilike_impl: Apply regex.is_match()
end
ilike_impl->>ilike_impl: collect() to Vec<Option<bool>>
end
ilike_impl->>BooleanArray: from((name, result_vec.as_slice()))
BooleanArray-->>ilike_impl: BooleanArray instance
ilike_impl->>ilike_impl: assert_eq!(result.len(), expected_size)
ilike_impl-->>Caller: Return BooleanArray
end
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5936 +/- ##
==========================================
- Coverage 72.48% 72.48% -0.01%
==========================================
Files 966 966
Lines 125839 125870 +31
==========================================
+ Hits 91213 91232 +19
- Misses 34626 34638 +12
🚀 New features to boost your workflow:
|
Summary
ilike.rsfrom arrow2 to native Daft array APIsdaft_arrow::array::BooleanArraycollection withVec<Option<bool>>BooleanArray::from((name, slice))instead of arrow2BooleanArrayTest plan
cargo test -p daft-functions-utf8 ilikepasses (4 tests)🤖 Generated with Claude Code