Skip to content

fix(schema): degrade gracefully when system.dictionaries SELECT is denied#57

Merged
BorisTyshkevich merged 2 commits into
mainfrom
fix/schema-lineage-dictionaries-graceful
Jun 28, 2026
Merged

fix(schema): degrade gracefully when system.dictionaries SELECT is denied#57
BorisTyshkevich merged 2 commits into
mainfrom
fix/schema-lineage-dictionaries-graceful

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Problem

The schema/lineage graph hard-fails for low-privilege users. loadSchemaLineage read system.dictionaries through the throwing queryJson, so a user with SHOW grants but no SELECT ON system.dictionaries (e.g. the antalya demo/demo and Google-OAuth roles) hit Code 497 ACCESS_DENIED and the entire graph failed to render.

Verified live on antalya as demo/demo: system.tables and system.columns already work for such users (implicit via their SHOW TABLES/SHOW COLUMNS privileges), but system.dictionaries, system.data_skipping_indices, and system.parts all 497. The latter two already degraded gracefully via tryQueryData; system.dictionaries was the lone throwing read that aborted the whole graph.

Fix

Switch the system.dictionaries read to the best-effort tryQueryData helper, matching loadSchemaCards (system.data_skipping_indices) and loadTableDetail (system.parts). A denied/missing system.dictionaries now yields no dictionary edges instead of aborting — so the graph draws with no grant change required on the cluster.

Test

Added a loadSchemaLineage test that returns ACCESS_DENIED for system.dictionaries and asserts the tables still load and dictionaries === []. Full suite: 1003 passing, per-file coverage gate held.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YDq48xZSSAreCbtaq83uVm

BorisTyshkevich and others added 2 commits June 28, 2026 08:04
…nied

loadSchemaLineage read system.dictionaries via the throwing queryJson, so a
low-privilege user (e.g. a demo/OAuth role with SHOW grants but no
SELECT ON system.dictionaries) hit Code 497 ACCESS_DENIED and the entire
schema/lineage graph failed to render.

Switch that read to the best-effort tryQueryData helper, matching how
system.data_skipping_indices (loadSchemaCards) and system.parts
(loadTableDetail) already degrade: a denied/missing system.dictionaries now
yields no dictionary edges instead of aborting the graph.

system.tables/system.columns already work for such users via their implicit
SHOW TABLES/COLUMNS privileges, so the graph now draws with no grant change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDq48xZSSAreCbtaq83uVm
Explain that the lineage graph works with no extra grants (the implicit
SELECT from SHOW TABLES/COLUMNS covers system.tables/columns, row-filtered to
accessible DBs), and that SELECT on system.dictionaries / data_skipping_indices
/ parts only buys fidelity (dictionary edges, skip-index badges, per-partition
detail). Adds a no-degrade grant snippet and notes secrets stay masked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDq48xZSSAreCbtaq83uVm
@BorisTyshkevich BorisTyshkevich merged commit 28be828 into main Jun 28, 2026
6 checks passed
@BorisTyshkevich BorisTyshkevich deleted the fix/schema-lineage-dictionaries-graceful branch June 28, 2026 06:14
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.

1 participant