Area: Ingestion
Sub-Area: Snowflake
Applies to: OSS + Cloud
Issue
After you create a view in Snowflake and run DataHub ingestion, the view appears in DataHub but its columns or definition are missing.
You Might Be Asking
- Why is my new Snowflake view missing columns?
- Why do some views ingest correctly but not others?
- Do views, materialized views or external tables need special configuration?
- How do I turn on debug logging for a Snowflake run?
Cause
DataHub reads the columns of every table, external table, view and materialized view from one place: the information_schema.columns view in the object's own database. It does not parse the view SQL to get columns. Each run reads view definitions and columns and emits them in that same run. Nothing is deferred to a later run, so waiting does not help.
If information_schema.columns returns no rows for a view, DataHub ingests the view with an empty column list and raises no error. If the column query itself fails, the run reports the warning Failed to get columns for view.
A view that still has no columns after one successful run points to missing grants or to a warning in the run report, not to timing. DataHub needs USAGE on the database and the schema. If a view has grants but its schema or database does not, DataHub can't get its metadata.
Materialized views and external tables need no special setting. include_views defaults to true and brings in materialized views. table_types defaults to BASE TABLE and EXTERNAL TABLE. The one exception is fetch_views_from_information_schema: true, which does not report materialized views.
Solution
1. Check the run report and logs.
Open the run in the UI and look for warnings in the run summary, such as Failed to get columns for view. For full logs, see Viewing detailed logs.
2. Check the grants.
Grant the DataHub role:
- OPERATE and USAGE on the warehouse.
- USAGE on the database and on all and future schemas.
- REFERENCES on all and future views. This is the only view grant in the DataHub docs. Keep it if you turn on profiling or classification. The SELECT grants for profiling cover tables, external tables and dynamic tables, and they don't replace the view grant.
- Without profiling or classification: REFERENCES on all and future tables and external tables.
- With profiling or classification: SELECT on all and future tables, external tables and dynamic tables.
See Prerequisites and grants for the exact statements.
3. Check the recipe options.
These options default to true, so you only need to set them if you changed them:
source:
type: snowflake
config:
include_views: true
include_view_definitions: true
include_technical_schema: true
Don't use include_view_lineage or include_view_column_lineage. They were removed in December 2024. DataHub drops them with a warning and they have no effect. See Snowflake source options.
4. Run again with debug logging.
- UI ingestion: open the source, go to Advanced Settings and turn on Debug Mode. See Advanced Settings.
- CLI: run
datahub --debug ingest -c recipe.yaml.
Recipes have no debug or debug_mode key. Adding one makes the recipe fail validation.
--no-default-report only stops the CLI from sending the run report to DataHub. It does not force a full refresh and does not affect stateful ingestion.
5. Workaround: add the columns by hand.
If the columns are still missing after you fix the grants, you can emit a schema yourself. The Python SDK has no patch operation that adds or changes schema columns, so you must emit a complete SchemaMetadataClass aspect for the dataset. A later ingestion run may overwrite it.
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
from datahub.metadata.schema_classes import (
OtherSchemaClass,
SchemaFieldClass,
SchemaFieldDataTypeClass,
SchemaMetadataClass,
StringTypeClass,
)
fields = [
SchemaFieldClass(
fieldPath="column1",
type=SchemaFieldDataTypeClass(type=StringTypeClass()),
nativeDataType="VARCHAR(100)",
description="Column 1 description",
),
]
schema_metadata = SchemaMetadataClass(
schemaName="your_view",
platform="urn:li:dataPlatform:snowflake",
version=0,
hash="",
platformSchema=OtherSchemaClass(rawSchema=""),
fields=fields,
)
dataset_urn = "urn:li:dataset:(urn:li:dataPlatform:snowflake,database.schema.view,PROD)"
emitter = DatahubRestEmitter(
gms_server="https://<your-domain>.acryl.io/gms",
token="<your token>",
)
emitter.emit(MetadataChangeProposalWrapper(entityUrn=dataset_urn, aspect=schema_metadata))
For DataHub Cloud, a token is required. For the emitter options, see REST emitter.
If the issue persists, contact DataHub Support with the view's DDL and the ingestion logs.