-
Notifications
You must be signed in to change notification settings - Fork 229
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
Snowflake COPY INTO cannot use Snowflake S3 Stage #2342
Labels
bug
Something isn't working
Comments
Hey @stevenayers , thanks for raising this, I will move it to planned. Would you be up to providing a PR for this? |
Sure 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dlt version
1.7.0
Describe the problem
Unless your Snowflake S3 stage is the root of an S3 bucket, gen_copy_sql interpolates the relative path of your staged files incorrectly.
The ingestion will fail, because we're using
parsed_file_url.path.lstrip('/')
to get the path of the staging file, which doesn't take into account that the snowflake s3 stage may make up part of theparsed_file_url.path
.dlt/dlt/destinations/impl/snowflake/snowflake.py
Lines 131 to 134 in eac0204
Example Code:
The staging files are saved to:
s3://my-bucket-name/dlt/my_dataset/jaffle_shop/
✅But the COPY INTO looks for files at:
s3://my-bucket-name/dlt/dlt/my_dataset/jaffle_shop/
❌Generated COPY INTO
Error:
Expected behavior
gen_copy_sql should generate:
Steps to reproduce
s3://my-bucket-name/dlt/
)Operating system
macOS
Runtime environment
Local
Python version
3.10
dlt data source
No response
dlt destination
Snowflake
Other deployment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: