Skip to content

DM-56079: Support ref-match tables that reference director tables in different databases - #1101

Open
malensek wants to merge 3 commits into
mainfrom
tickets/DM-56079
Open

malensek wants to merge 3 commits into
mainfrom
tickets/DM-56079

Conversation

@malensek

@malensek malensek commented Sep 14, 2026

Copy link
Copy Markdown
Member

Previously, ref-match tables were assumed to always reference tables within their own database. If a table was ingested that referenced a director in a different database than its own, it would fail query analysis. This adds support for ref-match tables that reference directors outside its own database.

Summary of changes

  • MatchTableParams has two new members, dirDb1 and dirDb2 to track director database names (if they exist)
  • TableInfoPool now checks for the director database name when populating MatchTableParams
  • The ingest system and CSS have been updated to preserve this information
  • Added a multi-db integration test based on data/case03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Legacy CSS metadata remains incompatible, and the query-analysis behavior lacks coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds cross-database director resolution for ref-match tables.

Changes:

  • Extends match metadata with director database names.
  • Preserves this metadata through ingest and CSS.
  • Resolves directors using their specified databases.
File summaries
File Description
src/replica/contr/HttpIngestModule.cc Publishes director database metadata.
src/qana/TableInfoPool.cc Resolves cross-database directors.
src/css/testCssAccess.cc Tests CSS metadata persistence.
src/css/MatchTableParams.h Adds director database fields.
src/css/CssAccess.cc Reads and writes the new fields.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/qana/TableInfoPool.cc
Comment thread src/qana/TableInfoPool.cc
Comment on lines +109 to +112
infoPtr->director.first =
dynamic_cast<DirTableInfo const*>(get(m.dirDb1.empty() ? db_ : m.dirDb1, m.dirTable1));
infoPtr->director.second =
dynamic_cast<DirTableInfo const*>(get(m.dirDb2.empty() ? db_ : m.dirDb2, m.dirTable2));

@iagaponenko iagaponenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. However, we should add a test case (a dataset) to test this feature in the integration test.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Table-configuration export still drops director database qualifiers, breaking export and re-ingest of the newly supported tables.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 31/34 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/replica/contr/HttpIngestModule.cc
`test_cases` entries can now include an optional `databases` key that
allows several database `root`, `data`, `schema`, etc to be listed. If
not present, the previous behavior is used (one database per integration
test).
@malensek
malensek marked this pull request as ready for review September 16, 2026 20:10
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.

3 participants