duckdb: enable csr_rel_ traversal and fix join push-down naming - #67
Merged
Conversation
- DuckDBScanBindData carries real typed columns plus optional src/dst scan column positions; csr_rel_* tables (internalIDContract=true) record them so ForeignRelTable::scanInternal can wrap FK values as node offsets. rel_* tables keep the fail-fast contract. - Fix the move-out bug where columnTypes was moved into DuckDBTableScanInfo before the bind-data columns were built. - Store the attached-database name (not the schema-qualified catalog name) in shadow node entries and rel group entries, and set rel group storage to "<db>.<table>", matching pg_client: the ForeignJoinPushDownOptimizer uses these for its same-database check and SQL construction, enabling MATCH traversal push-down to duckdb. - sqlite/postgres: pass the attached dbName to DuckDBCatalog (fixes build after the constructor change). - Test: csr_rel_user_blocks_user traversal returns 2 rows via SQL push-down.
…talog attach - Reorder DuckDBCatalog member declarations/init list to match (fixes -Wreorder-ctor). - unity_catalog attach path was missed by the new attachedDbName ctor parameter; pass it so unity_catalog builds again.
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.
Supersedes #31 (closed, not reopenable).
Enables MATCH traversal over
csr_rel_*foreign rel tables:DuckDBScanBindDatanow carries real typed columns (VariableExpressions) plus optional src/dst scan column positions. Forcsr_rel_*tables (internalIDContract=true) the positions are recorded soForeignRelTable::scanInternalcan wrap foreign-key values directly as node offsets (internalID_t{offset=fkValue, tableID}) — thecsr_rel_prefix promises offset-compatible FKs.rel_*tables keep the fail-fast contract.columnTypeswas moved intoDuckDBTableScanInfobefore the bind-data columns were built (cause of the result-converter segfault)."<db>.<table>", matching pg_client:ForeignJoinPushDownOptimizeruses these for its same-database check and SQL construction, enabling MATCH traversal push-down to a single duckdb SQL join.ForeignJoinPushDownOptimizer(main repo): normalizes rel foreignDatabaseName to thedb(TYPE)node-name format so the same-database check passes for both DDL-created and extension-registered name shapes.resolveTableStorage(main repo): falls through to main-path resolution for non-LBUG attached DBs instead of throwing.DuckDBCatalogconstructor parameter.Test:
csr_rel_user_blocks_usertraversal returns 2 rows via SQL push-down; rel_/csr_rel_ LOAD FROM and node-count cases unchanged.Depends on LadybugDB/ladybug#844 (
ForeignRelTable::scanInternalcontract + optimizer fixes).