Area: Ingestion
Sub-Area: Snowflake
Applies to: OSS + Cloud
Issue
You ingest a Snowflake database that has more than 10,000 views. Some views are missing from DataHub, or the view-listing step does not finish. You may see no error.
Snowflake SHOW commands return at most 10,000 rows. Older DataHub CLIs listed views with one database-wide SHOW VIEWS ... LIMIT 10000 FROM '<last view name>' paging query. That cursor matches on view name only, not on schema plus name. Views in later schemas whose names sort below the cursor are silently dropped, and some views come back twice. If a page ends on an INFORMATION_SCHEMA view name, the cursor is ignored and paging never ends.
You Might Be Asking
- Why are views missing from my Snowflake ingestion?
- Does DataHub run
SHOW TABLES, and do tables hit the 10,000 limit? - Do I need
fetch_views_from_information_schema: true? - Which CLI version fixes this?
Cause
- Tables are not affected. The connector never runs
SHOW TABLES. It reads tables frominformation_schema.tables. - Only views are listed with
SHOW VIEWS, and older CLIs paged that listing in a way that fails past 10,000 views. - The symptom is missing views or a view-listing step that does not finish, not an error.
Solution
Upgrade the CLI (recommended). Use DataHub CLI 1.7.0.20 or later. In that version, the connector first tries one database-wide SHOW VIEWS. When that page comes back full, it pages SHOW VIEWS per schema by object name. Databases with more than 10,000 views need no extra setting. DataHub Cloud server releases from v2.3.0 on include the same paging.
- OSS: upgrade
acryl-datahubto 1.7.0.20 or later. - Cloud UI ingestion: open the ingestion source, go to Advanced Settings, and set CLI Version to 1.7.0.20 or later. See UI ingestion advanced settings.
In a current CLI, the run logs this info message when the database-wide page is full and the connector falls back to per-schema queries:
Database-wide 'SHOW <kind>' for <db> filled its 10000-row page; falling back to per-schema queries
If paging fails, the run reports one of these instead:
Paginated 'SHOW' stopped early because Snowflake did not honour the pagination cursor; some objects may be missing.Paginated 'SHOW' failed for schema; results may be incomplete
Workaround if you can't upgrade: fetch_views_from_information_schema. This option lists views from information_schema.views instead of SHOW VIEWS. It first appears in CLI 1.3.0, and older CLIs reject it as an unknown key. In CLI 1.7.0.20 you don't need it for large view counts. Use it on 1.3.0 or later only if you can't upgrade, or if you want view_pattern pushdown or an accurate last_altered.
source:
type: snowflake
config:
# ... your connection settings ...
fetch_views_from_information_schema: true
Trade-offs:
- It needs a running warehouse.
SHOWdoes not. - It does not report materialized views.
-
information_schema.viewsshowsVIEW_DEFINITIONonly to the view owner. DataHub backfills definitions for other views with batchedSHOW VIEWS.
Narrow the scope. If you don't need every database, use database_pattern to leave out the large ones. Patterns are regular expressions that match from the start of the name, and deny wins over allow. Anchor names for an exact match.
source:
type: snowflake
config:
# ... other config ...
database_pattern:
allow:
- '^PROD_DB$'
- '^STAGING_DB$'
deny:
- '^LARGE_VIEW_DB$'
Permissions. DataHub's documented grants give the role usage on the warehouse, usage on the database and its schemas, and REFERENCES (or SELECT with profiling) on tables and views. They include no grants on INFORMATION_SCHEMA. If a view's schema or database has no USAGE grant, DataHub can't get its metadata. See Snowflake prerequisites.
Do not use these.
-
fetch_tables_from_information_schemadoes not exist. Snowflake recipes reject unknown keys, so the recipe fails validation and the run does not start. -
SHOW TABLESis never run, so there is nothing to bypass for tables.