Read a Snowflake catalog - #277
Merged
Merged
Conversation
jat255
marked this pull request as draft
September 4, 2026 05:56
jat255
force-pushed
the
jat255/xp65-snowflake-reader
branch
from
September 5, 2026 04:58
58b3ef1 to
66796a2
Compare
jat255
force-pushed
the
jat255/xp65-snowflake-reader
branch
from
September 6, 2026 02:07
66796a2 to
475783c
Compare
Collaborator
Author
|
Manual review completed 2026-09-05 23:20 MDT by @jat255. Findings: 1 MEDIUM (untested current-namespace fallback in |
jat255
marked this pull request as ready for review
September 6, 2026 05:23
Third of the catalog import stack (kata xp65). Ports the catalog-import half of catalog-snowflake.R: the current namespace, SHOW OBJECTS listing and exact lookup, DESC TABLE column description, and the identifier quoting each needs. The queries are kept apart from the interpretation of their rows, following the R structure, which is what makes this testable without a warehouse: the row readers are pure and run against real SHOW OBJECTS and DESC TABLE shapes. The query builders are checked by recording the SQL they send, which is the one test double here and stands in for a network rather than for Snowflake's semantics. SHOW caps its output and a full page cannot be told apart from a page that happened to fill, so a full page is refused rather than silently truncated. SHOW OBJECTS LIKE ignores case, so its reply is filtered by exact name: asking for ORDERS and getting `orders` means a differently-cased table exists, not the one that was named. The semantic-view half of the R file is not ported and is now kata gcgj. It is a feature rather than part of catalog import, and pkg-py has no surface for it at all: R threads semantic models through ten files including commons.R, context-layer.R and pool.R, so a reader alone would produce records nothing consumes. The name filter was found to be uncovered by perturbing it and watching nothing fail; the empty-reply test could not reach it. A near-match case covers it now.
SHOW OBJECTS LIKE is capped like any other SHOW, and a full page may have dropped the match, which reported an existing table as absent. A deliberate divergence from R, which checks only when listing a namespace. The case needs a schema holding a page-full of case-variant names so it is vanishingly rare, but when it happens Python now fails loudly instead of answering wrongly, and the reason is recorded next to the check and in the test. Found by roborev job 333.
jat255
force-pushed
the
jat255/xp65-snowflake-reader
branch
from
September 6, 2026 06:29
1f35c73 to
d543eb3
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.
Third PR of the catalog import stack (kata xp65). Stacked on #275. Ports the catalog-import half of
catalog-snowflake.R: the current namespace,SHOW OBJECTSlisting and exact lookup,DESC TABLEcolumn description, and the identifier quoting each needs.The queries are kept apart from the interpretation of their rows, following the R structure: the row readers are pure and run against real
SHOW OBJECTSandDESC TABLEshapes, and the query builders are checked by recording the SQL they send.Two behaviors worth naming.
SHOWcaps its output and a full page cannot be told apart from a page that happened to fill, so a full page is refused rather than silently truncated. AndSHOW OBJECTS LIKEignores case, so its reply is filtered by exact name: asking forORDERSand getting backordersmeans a differently-cased table exists, not the one that was named.Deliberately out of scope: semantic views
About half of
catalog-snowflake.Ris Snowflake semantic views, and none of it is included in this PR. It is a feature rather than a part of catalog import Tracked locally as katagcgj, which also flags the question of how it relates to commons' own semantic layer.Verification
653 tests, ruff and pyrefly clean. Worth knowing: the exact-name filter was originally uncovered. Perturbing it failed nothing, because the only test reaching that path supplied an empty reply. A near-match case covers it now, and that is why the perturbation pass is worth doing rather than trusting a green suite.