Area: Ingestion Issues
Sub-Area: Snowflake Connector, AI Documentation
Applies to: Cloud
Issue
You click Generate with AI on a Snowflake dataset in DataHub Cloud, often a Snowflake semantic view. The request fails with this error:
Failed to generate summary. followed by The AI service encountered an error. Please try again in a few moments. If the issue persists, contact your DataHub administrator.
The same button works on other Snowflake tables.
You Might Be Asking
- Why does Generate with AI work for some Snowflake tables but fail for others?
- Can DataHub generate a description from the view definition alone?
- My ingestion run succeeded. Why does the asset still have no columns?
- How do I confirm that DataHub ingested my semantic views?
Cause
AI description generation reads the dataset's schema (its columns). If the dataset has no schema in DataHub, the AI service stops and DataHub shows the generic error above. The error does not name the cause. A view definition alone is not enough.
A Snowflake asset ends up with no schema for one of these reasons:
- Semantic views are not ingested by default. The Snowflake recipe needs
semantic_views.enabled: true. - The ingestion role cannot see the database. A role without
USAGEon a database does not see that database, so ingestion skips it and the run does not report an error for it. -
include_technical_schemais set tofalsein the recipe. This option controls column ingestion. Its default istrue.
A table with more than 3,000 columns also fails with the same error. See AI Documentation Generation Fails for Tables Exceeding Column Limit.
Solution
-
Check whether the asset has columns. Open the dataset in DataHub and click the Columns tab. If no columns show, the schema was not ingested, and Generate with AI fails for this asset.
-
Check that the ingestion role can see every database. In the ingestion run report,
databases_scannedcounts the databases that the role can see. A database withoutUSAGEis not counted. By default the count includes visible databases outside yourdatabase_pattern, so compare it with the databases the role should see. The run log also has oneStage started: <DATABASE_NAME>: Metadata Extractionline for each database that was processed. If a database you expect is not counted, grant the role access to it in Snowflake. These grants come from the Snowflake connector prerequisites:grant usage on DATABASE "<your-database>" to role datahub_role; grant usage on all schemas in database "<your-database>" to role datahub_role; grant usage on future schemas in database "<your-database>" to role datahub_role; grant references on all tables in database "<your-database>" to role datahub_role; grant references on future tables in database "<your-database>" to role datahub_role; grant references on all views in database "<your-database>" to role datahub_role; grant references on future views in database "<your-database>" to role datahub_role;The view grants also cover semantic views. A semantic view needs
REFERENCESorSELECT. If you use profiling or classification, grantSELECTinstead ofREFERENCES, as the prerequisites list shows. -
Turn on semantic view ingestion and keep column ingestion on. Semantic views require Snowflake Enterprise Edition or above.
source: type: snowflake config: # ... your existing connection config ... include_technical_schema: true # default; ingests columns semantic_views: enabled: true # default is false database_pattern: allow: - "<your_database>"Column lineage settings (
include_column_lineage,semantic_views.column_lineage) control lineage only. They do not add columns to a dataset. -
Run ingestion again. In the run report, check that
semantic_views_scannedis greater than0. -
Find the right asset and try again. How a semantic view shows up depends on your DataHub Cloud version:
- On DataHub Cloud 2.1.0 and later, by default, each semantic view becomes a semantic model. Each logical table in it becomes its own dataset with the subtype Semantic Model Dataset, and that dataset has columns. Generate with AI works on datasets and queries only, so use it on these Semantic Model Datasets. The semantic model page has no Generate with AI button.
- On earlier versions, or when you set
semantic_views.emit_semantic_model_entities: falsein the recipe, each semantic view is one dataset with the subtype Semantic View. Open it, check the Columns tab, and click Generate with AI.
-
If the dataset has columns, has 3,000 or fewer columns, and Generate with AI still fails, contact DataHub Support. They can read the AI service logs for the exact failure.
Related Documentation
Tags: snowflake, semantic-views, ai-documentation, generate-with-ai, schemaMetadata, ingestion-permissions, snowflake-connector