Skip to content

add datafusion apis for list expressions - #53

Merged
yuvalif merged 3 commits into
lancedb:mainfrom
yuvalif:add_datafusion_list_expr
Jun 8, 2026
Merged

yuvalif merged 3 commits into
lancedb:mainfrom
yuvalif:add_datafusion_list_expr

Conversation

@yuvalif

@yuvalif yuvalif commented May 28, 2026

Copy link
Copy Markdown
Collaborator

currently only the array_has api is implemented

yuvalif added 2 commits June 8, 2026 11:06
currently only the array_has api is implemented

Fixes: lancedb#52

Signed-off-by: Yuval Lifshitz <[email protected]>
support array_has() on JSON arrays

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif force-pushed the add_datafusion_list_expr branch from c2f1bfb to e606e7d Compare June 8, 2026 11:16
@yuvalif
yuvalif requested a review from Copilot June 8, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the C DataFusion-expression API surface to support “list membership” filters, adding both a general array_has expression for Arrow list columns and a JSON-specific json_array_has helper built from json_get_array + array_has.

Changes:

  • Add lancedb_expr_array_has for filtering on list<T> columns via DataFusion’s array_has UDF.
  • Add lancedb_expr_json_array_has to test membership within JSON array fields, with configurable quoting/casting behavior for string vs numeric/bool arrays.
  • Add comprehensive test coverage for both DataFusion query filtering and JSON matching semantics, plus new DataFusion function dependencies.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/test_json.cpp Adds extensive JSON-array membership tests for json_array_has, including scalar and non-scalar element cases.
tests/test_df_query.cpp Adds query-level tests demonstrating array_has filtering on list<utf8> columns and null-argument handling.
src/json.rs Implements lancedb_expr_json_array_has by composing json_get_array with array_has and adapting the search value.
src/expr.rs Exposes lancedb_expr_array_has as a new C-callable DataFusion expression builder.
include/lancedb.h Adds public C API declarations/docs for lancedb_expr_array_has and lancedb_expr_json_array_has.
Cargo.toml Adds DataFusion function crates needed for concat and array_has.
Cargo.lock Locks newly added Rust dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_json.cpp Resolved
Comment thread tests/test_df_query.cpp Resolved
Comment thread tests/test_df_query.cpp Resolved
Comment thread tests/test_df_query.cpp Resolved
Comment thread tests/test_df_query.cpp Resolved
Comment thread tests/test_df_query.cpp Resolved
@yuvalif
yuvalif merged commit 01b716d into lancedb:main Jun 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants