Skip to content

Fix Thrift getFunctions catalog metadata - #536

Merged
vuanhphung merged 1 commit into
mainfrom
vuanhphung/fix-thrift-function-cat
Oct 1, 2026
Merged

vuanhphung merged 1 commit into
mainfrom
vuanhphung/fix-thrift-function-cat

Conversation

@vuanhphung

Copy link
Copy Markdown
Collaborator

Override native Thrift getFunctions() rows' FUNCTION_CAT with the original requested catalog, matching kernel and JDBC. Covers Arrow and column-based results, including prefetched data and omitted catalogs; other operations and empty-catalog validation are unchanged.

Adds 35 regression tests. All 1,349 unit tests pass with inherited agent markers cleared; library/test type-checks, targeted ESLint, Prettier, and diff checks pass. The standard type-check still fails on existing example self-imports. Live comparator not rerun.


This PR was created with GitHub MCP.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: 1 Low

Focused, well-tested fix — the undefined sentinel cleanly scopes the override to getFunctions, and the row === null guard preserves disableRowMaterialization placeholders correctly. One low-severity question: the override unconditionally rewrites FUNCTION_CAT on every row, forcing null for omitted catalogs and the literal pattern for wildcards, which the PR itself notes wasn't re-verified live.

return rows;
}

// Native GetFunctions leaves FUNCTION_CAT empty; match JDBC and kernel.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Low — This overwrites FUNCTION_CAT on every returned row with the literal requested catalogName, including two cases that discard/mislabel server data:

  • Omitted catalog (catalogName === undefined → functionCatalog === null): every row's FUNCTION_CAT is forced to null, throwing away the actual catalog names the server returned. A caller doing getFunctions({ functionName: '%' }) across all catalogs now loses that column entirely.
  • Wildcard/pattern catalog (e.g. catalogName: '%'): every row is stamped with the literal string '%', which is not a real catalog name — so rows that legitimately span multiple catalogs are all mislabeled.

The tests assert exactly this behavior, so it is intentional and claimed to match JDBC/kernel — but JDBC's getFunctions catalog argument is an exact name (not a pattern), whereas the Thrift catalogName here can be a pattern. Since the PR notes the live comparator was not rerun, please confirm against a live warehouse that stamping null/pattern values (rather than passing rows through) is the intended parity behavior for the omitted-catalog and wildcard cases.

@vuanhphung vuanhphung added the integration-test Trigger the cross-repo driver-test Node.js integration suite on this PR label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Node.js integration tests triggered. View workflow runs. The result posts back here as the "Node.js Integration Tests" check.

@vuanhphung
vuanhphung added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit be677a6 Oct 1, 2026
43 of 45 checks passed
@vuanhphung
vuanhphung deleted the vuanhphung/fix-thrift-function-cat branch November 5, 2026 06:43

This branch was previously deployed

1 inactive deployment
azure-prod — 5a0c2a7b Deployed Sep 30, 2026 by vuanhphung via e2e-test (24) #1626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted integration-test Trigger the cross-repo driver-test Node.js integration suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants