fix(core): handle null candidate in sqlite json contains simulation - #1298
Merged
AlessandroPomponio merged 1 commit intoJul 28, 2026
Merged
Conversation
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
christian-pinto
approved these changes
Jul 28, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 28, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 28, 2026
AlessandroPomponio
deleted the
ap_1297_handle_null_candidates_in_sqlite_json_contains
branch
July 28, 2026 12:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug in the SQLite fallback for
JSON_CONTAINSwhere filtering by anullvalue would return no results instead of matching rows where the field is explicitlynullor absent entirely.High-level Changes
ado/metastore/sql/statements.py: Added a short-circuit insimulate_json_contains_on_sqliteto handlenullcandidates. When the candidate isnull, the function now emits a simplerjson_extract(...) IS NULLquery instead of delegating tojson_tree-based subqueries (which only emit rows for fields that exist and would therefore never match missing or null fields).tests/metastore/test_sql_utils.py: Added an integration test that creates an in-memory SQLite database with three rows — one with an explicitnullfield, one with the field missing entirely, and one with a real value — and asserts that filtering bynullreturns only the first two rows.Impact
Queries that filter metastore resources by a
nullmetadata field now return the correct results on SQLite. No changes to the public API or database schema; the fix is internal to the SQLite JSON-contains simulation logic.AI Disclosure
The code and this PR description were generated using IBM Bob and reviewed manually.