Skip to content

DOC-581 [SnowflakeImport] Adding a FAQ session to Snowflake Import doc #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions content/collections/source-catalog/en/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,50 @@
1. **Error: `SQL compilation error: Invalid identifier INFORMATION_SCHEMA.QUERY_HISTORY_BY_SESSION. Results not generated.`**

- **Cause**: This occurs when the Snowflake role used for the integration no longer has permission to access the `INFORMATION_SCHEMA` of the specified Snowflake database. Amplitude requires access to this schema to check the status of queries running on the customer's Snowflake instance.
- **Solution**: Ensure that the role used for the integration has the necessary permissions to access the `INFORMATION_SCHEMA` in the target Snowflake database. This issue often arises if the role was recently changed or updated without the appropriate access being maintained.
- **Solution**: Ensure that the role used for the integration has the necessary permissions to access the `INFORMATION_SCHEMA` in the target Snowflake database. This issue often arises if the role was recently changed or updated without maintaining the appropriate access.

2. Error: `JWT token is invalid.`
1. Error: `JWT token is invalid.`

- **Cause**: This error appears when there is a mismatch between the public key attached to the given user and the private key Amplitude generates for key pair authentication.
- **Solution**: Ensure that the public key is properly set on the given user, and that the account is provided in the format `ORGNAME-ACCOUNTNAME`. If the account has an account locator at the end, key pair authentication may not succeed, even if the public key is set properly. To get the account identifier in the correct format, run `SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();` in your Snowflake instance.
- **Solution**: Ensure that the public key is properly set on the given user, and that you provide the account in the format `ORGNAME-ACCOUNTNAME`. If the account has an account locator at the end, key pair authentication may not succeed, even if the public key is set properly. To get the account identifier in the correct format, run `SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();` in your Snowflake instance.

## Frequently asked questions

Review the list topics below if you encounter issues with your Snowflake integration.

### What happens when a Snowflake query times out?

Check warning on line 540 in content/collections/source-catalog/en/snowflake.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.HeadingPunctuation] Don't use end punctuation in headings. Raw Output: {"message": "[Amplitude.HeadingPunctuation] Don't use end punctuation in headings.", "location": {"path": "content/collections/source-catalog/en/snowflake.md", "range": {"start": {"line": 540, "column": 49}}}, "severity": "WARNING"}

When a Snowflake query times out, Amplitude automatically retries the query using an exponential backoff strategy. Each retry attempt waits progressively longer than the previous one, giving Snowflake more time to process the request successfully.

### How many times does Amplitude retry failed queries?

Check warning on line 544 in content/collections/source-catalog/en/snowflake.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.HeadingPunctuation] Don't use end punctuation in headings. Raw Output: {"message": "[Amplitude.HeadingPunctuation] Don't use end punctuation in headings.", "location": {"path": "content/collections/source-catalog/en/snowflake.md", "range": {"start": {"line": 544, "column": 54}}}, "severity": "WARNING"}

Amplitude attempts up to 8 retries (9 total attempts including the initial query) before marking an import job as failed. Each retry attempt starts fresh, ensuring a consistent approach to retrieving your data.

### Why should I set ABORT_DETACHED_QUERY to FALSE?

Check warning on line 548 in content/collections/source-catalog/en/snowflake.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.Headings] 'Why should I set ABORT_DETACHED_QUERY to FALSE?' should use sentence-style capitalization. Raw Output: {"message": "[Amplitude.Headings] 'Why should I set ABORT_DETACHED_QUERY to FALSE?' should use sentence-style capitalization.", "location": {"path": "content/collections/source-catalog/en/snowflake.md", "range": {"start": {"line": 548, "column": 5}}}, "severity": "WARNING"}

Setting `ABORT_DETACHED_QUERY = FALSE` at the account level prevents Snowflake from silently canceling import queries that run longer than 5 minutes. Without this setting:

- Snowflake cancels long-running queries without notification
- Amplitude interprets this as a temporary failure and retries
- This can lead to duplicate events and inflated event counts

While this setting doesn't change Amplitude's retry mechanism, it prevents unnecessary retries caused by Snowflake's automatic query cancellation.

### How can I prevent duplicate data during imports?

Check warning on line 558 in content/collections/source-catalog/en/snowflake.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.HeadingPunctuation] Don't use end punctuation in headings. Raw Output: {"message": "[Amplitude.HeadingPunctuation] Don't use end punctuation in headings.", "location": {"path": "content/collections/source-catalog/en/snowflake.md", "range": {"start": {"line": 558, "column": 51}}}, "severity": "WARNING"}

To prevent duplicate data during retries and overlapping imports:

- **Include an `insert_id`**: This unique identifier allows Amplitude to detect and ignore duplicate events
- **Set proper retry settings**: Configure `ABORT_DETACHED_QUERY = FALSE` to prevent unnecessary retries

Without an `insert_id`, Amplitude treats every incoming event as new, potentially leading to duplicate data, inflated event counts, and inaccurate analytics.

### Is there any risk of data loss during query timeouts?

Check warning on line 567 in content/collections/source-catalog/en/snowflake.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Amplitude.HeadingPunctuation] Don't use end punctuation in headings. Raw Output: {"message": "[Amplitude.HeadingPunctuation] Don't use end punctuation in headings.", "location": {"path": "content/collections/source-catalog/en/snowflake.md", "range": {"start": {"line": 567, "column": 56}}}, "severity": "WARNING"}

No, there is no risk of data loss when Amplitude import jobs time out. Here's why:

- **Read-only operations**: Amplitude only reads data from your Snowflake instance—it never modifies, deletes, or writes to your tables
- **Source data protection**: Timeouts occur during data transfer, not during any operation that could affect your source data
- **Automatic retries**: Failed imports are automatically retried up to 8 times, giving your data multiple opportunities to be successfully imported

Your Snowflake data remains completely safe and unchanged regardless of import job outcomes.
Loading