Fix shadow-table scan link and add SQL pushdown coverage - #88
Merged
Merged
Conversation
Capture the attached entry pointer before moving it into the catalog: reading it back from the moved-from unique_ptr always yielded null, so shadow node entries never exposed their scan function and no Cypher query over attached DuckDB node tables could plan a table-function scan (which also silently disabled all foreign join pushdown). Add pushdown_graph.db fixture plus sql_pushdown.test covering 1-hop, 2-hop with node/edge filters, aggregation + ORDER BY, and recursive-CTE pushdown.
adsharma
force-pushed
the
feature/sql-pushdown-extended
branch
from
September 20, 2026 04:38
b4de6c1 to
f09f80b
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.
Stacked on the DuckLake pushdown work (first commit below belongs to that series; this PR's change is the last commit).
Fix: moved-from pointer disabled all pushdown over attached node tables
In
DuckDBCatalog::createForeignTable, the attached entry pointer was read back from theunique_ptrafter moving it into the catalog, so it was always null. The shadow node entry'sreferencedEntrywas therefore null,getBoundScanInfo()returned null, and the planner emitted plainSCAN_NODE_TABLEinstead of a pushdown-capableTABLE_FUNCTION_CALL— silently disabling the entire foreign join pushdown (and failing MATCH traversal) for DuckDB-attached node tables. Fixed by capturing the raw pointer before the move (the catalog takes ownership, so it stays valid).Tests
Adds the
pushdown_graph.dbfixture (person/city nodes, knows/likes/lives-in rels with FKs) andsql_pushdown.testcovering:a.age > 30)r1.since,r2.score)count(*)+ORDER BY cnt DESC)-[e:rel_knows*1..3]->)-[e:rel_knows*1..2 {since: 2020}]->)Every MATCH here runs over
rel_*tables, whose local traversal errors out, so each passing result proves the pattern pushed to SQL. Requires the companion engine change (ladybug PR) for the multi-hop/agg/recursive cases; the 1-hop cases pass with this fix alone.CI: run the rest on CI (
make extension-testneeds the RelWithDebInfo extension tree).