
## Snowflake connectivity and crawling

URL: https://docs.atlan.com/apps/connectors/data-warehouses/snowflake/faq/snowflake-connectivity-and-crawling

> Frequently asked questions about Snowflake connectivity and crawling.

This FAQ answers common questions about Snowflake connectivity and crawling.

### Why are some assets from databases or schemas missing?

1. Check the grants on the role attached to the user defined for the crawler. Confirm that the missing database or schema is present in these grants.

 ```sql
 SHOW GRANTS TO ROLE atlan_user_role;
 ```

### Why are new tables or views missing?

1. When using incremental extraction, consider running a one-time full extraction to capture any newly introduced metadata.
2. Make sure the role attached to the user defined for the crawler has grants for future tables and views being created in the database:

 ```sql
 GRANT USAGE ON FUTURE SCHEMAS IN DATABASE "<database-name>" TO ROLE atlan_user_role;
 GRANT REFERENCES ON FUTURE TABLES IN DATABASE "<database-name>" TO ROLE atlan_user_role;
 GRANT REFERENCES ON FUTURE VIEWS IN DATABASE "<database-name>" TO ROLE atlan_user_role;
 GRANT REFERENCES ON FUTURE EXTERNAL TABLES IN DATABASE "<database-name>" TO ROLE atlan_user_role;
 ```

3. Make sure you run the below commands as well so that new tables and views you've created in-between are also visible to the user:

 ```sql
 GRANT USAGE ON ALL SCHEMAS IN DATABASE "<database-name>" TO role atlan_user_role;
 GRANT REFERENCES ON ALL TABLES IN DATABASE "<database-name>" TO role atlan_user_role;
 GRANT REFERENCES ON ALL EXTERNAL TABLES IN DATABASE "<database-name>" TO atlan_user_role;
 GRANT REFERENCES ON ALL VIEWS IN DATABASE "<database-name>" TO role atlan_user_role;
 ```

### My Snowflake crawler has been running for more than 24 hours—does it time out?

The default workflow timeout is **72 hours** (259,200 seconds). A crawl running for 24 hours is still well within this window—no action is required. [Contact Atlan support](https://docs.atlan.com/support/submit-request) if you need to extend the crawl beyond 72 hours.

### Why is some lineage missing?

- The query miner mines query history for up to the previous two weeks. It doesn't mine queries older than that. If the queries that created your assets ran earlier, lineage for those assets isn't available.
- Lineage is unsupported for parameterized queries. Snowflake currently [does not resolve values](https://community.snowflake.com/s/article/How-to-rebuild-parameterized-queries-from-bind-variables) for parameterized queries before logging them in query history. This limits Atlan from generating lineage in such cases.
- Snowflake truncates queries longer than 100K characters in its [query history](https://docs.snowflake.com/en/sql-reference/account-usage/query_history). When a query is truncated, Atlan can't parse the full statement, so lineage for the assets it created isn't available.

1. To mine more than two weeks of query history, use [S3-based query mining](https://docs.atlan.com/llms/catalog/connector-capabilities/mine-queries-through-cloud-object-storage/llms.txt) or [contact Atlan support](https://docs.atlan.com/support/submit-request). Snowflake retains query history for a limited time. If Snowflake no longer retains the query history, Atlan can't mine it for lineage.

### Missing attributes and lineage

- When using the account usage extraction method, there are currently some limitations. Atlan works with Snowflake to find workarounds for crawling the following:
 - External table location data
 - Procedures
 - Primary key designation
- Furthermore, only database-level filtering is currently possible.

### What views does Atlan require access to for account usage method?

When using the [account usage method](https://docs.atlan.com/llms/connectors/snowflake/permissions/llms.txt) for fetching metadata, Atlan requires access to the following views in Snowflake:

- For the crawler: `DATABASES`, `SCHEMATA`, `TABLES`, `VIEWS`, `COLUMNS`, `FUNCTIONS`, and `PIPES`
- For the miner and [popularity metrics](https://docs.atlan.com/llms/catalog/usage-and-popularity/interpret-usage-metrics/llms.txt): `QUERY_HISTORY`, `ACCESS_HISTORY`, and `SESSIONS`

### Why does crawling with 0 matching tables still take long time?

When you use the Account Usage extraction method, Snowflake scans the entire account-wide `ACCOUNT_USAGE` views before Atlan applies your database or schema filters. Filtering happens after the scan, not before, so 0 matching tables doesn't mean 0 work was done.

This can happen if your filters are scoped to a database or schema that turns out to have no matching tables, or if you're crawling a small or empty schema on a large Snowflake account. The crawler still pays the full `ACCOUNT_USAGE` scan cost regardless of how narrow the filter is—on large accounts, this can take anywhere from tens of minutes to a couple of hours.

If a filtered crawl is running long and shows 0 matches, this is expected Account Usage behavior, not a hang. Subsequent runs against the same account are often faster because Snowflake's query result cache can help, but this isn't guaranteed every time.

This only applies to the Account Usage extraction method. The Information Schema extraction method always performs a full scan on every run, regardless of filters.

### Why do I get destination URL mismatch error when authenticating via Okta SSO?

This error can occur when you're connecting to Snowflake through [Okta SSO](https://docs.atlan.com/llms/connectors/snowflake/set-up-snowflake/llms.txt) and enter the URL of your Snowflake instance in a format different from the one used in Okta.

Snowflake follows two URL formats:

- Legacy format -  `..snowflakecomputing.com` or `..<cloud>.snowflakecomputing.com`
- New URL format - `-.snowflakecomputing.com`

Use the same Snowflake URL format in Snowflake and Okta. Refer to [Snowflake documentation](https://community.snowflake.com/s/article/Destination-URL-mismatch-when-using-Native-OKTA-SSO) to learn more.

### Why do I get 'name or service not known' error when connecting via private link?

You may see errors like `java.net.UnknownHostException` or "Name or service not known" when connecting to Snowflake over private link if all of the following are true:

- You are using Snowflake JDBC driver version 3.13.25 or newer
- Your Snowflake account name contains an underscore (`_`)
- You are connecting via [private link](https://docs.atlan.com/llms/connectors/snowflake/set-up-an-aws-private-network-link-to-snowflake/llms.txt) (for example, `https://my_account.us-west-2.privatelink.snowflakecomputing.com`)

The newer Snowflake JDBC driver automatically replaces underscores (`_`) with hyphens (`-`) in the hostname. For normal (non-private link) connections, this works because Snowflake accepts both formats. For private link connections, the DNS endpoint only recognizes the original hostname. Because of this mismatch, the hostname can't be resolved and the connection fails.

1. Update your Snowflake hostname to use hyphens (`-`) instead of underscores (`_`).
2. Retry the connection.

For more details, refer to the [Snowflake documentation](https://community.snowflake.com/s/article/Behaviour-Change-Release-information-associated-with-Snowflake-JDBC-driver-version-3-13-25).

### How incremental metadata crawling works

It depends on which extraction method you use:

- **Account Usage method**: Supports incremental extraction—each run syncs only the changes since the previous run, not a full re-crawl. New tables, schema changes, and updated column descriptions are reflected in Atlan after the next workflow run.
- **Information Schema method**: Always performs a full crawl. Incremental extraction isn't available for this path.

---
