sql: include WHERE subquery inputs in lineage#4752
Merged
kacpermuda merged 1 commit intoJul 22, 2026
Conversation
mattfaltyn
marked this pull request as ready for review
July 21, 2026 18:43
kacpermuda
approved these changes
Jul 22, 2026
Co-Authored-By: OpenAI Codex <noreply@openai.com> Signed-off-by: Matt Faltyn <faltyn.matthew@gmail.com>
kacpermuda
force-pushed
the
agent/sql-predicate-subquery-inputs
branch
from
July 22, 2026 13:39
ea303d2 to
b93c6e9
Compare
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.
closes: #4751
One-line summary for changelog:
SQL parser: include input tables referenced by WHERE predicate subqueries in table lineage.
Meaningful description
Problem
Select::visittraversesFROMrelations, joins, and projections, but did not traverse the SELECTselectionexpression. As a result, queries such as:silently omitted
customersfromin_tables.Solution
Visit the selection expression in its own context frame, then collect its table dependencies and aliases without merging predicate-only column ancestry into projected column lineage.
Add a focused table-lineage regression test for a
WHERE EXISTSsubquery. The existing nested-subquery column-lineage test continues to pass and guards against predicate columns leaking into output column lineage.Impact
SQL parser consumers now receive complete input-table lineage for tables read only through WHERE predicate subqueries.
Validation
cargo testfromintegration/sql: 143 passed, 3 ignoredcargo fmt --all -- --checkEXISTSandINsubqueries, with projection-subquery controlsintegration/commonmypy setup failure passed on rerunChecklist