Realtime CSV data load to snowflake
Hi folks,
Does anyone worked here on loading CSV files to snowflake in near realtime basis.
I have a problem statement where I need to load data from CSV files to snowflake as soon as the file arrives in S3. Files are arriving in s3 every 30 seconds or in a minute.
What could be the best approach for this.
Any suggestions or helps are appreciated. thanks
Posted Mar 31, 2022, 3:33 PM UTC
Snowpipe is the obvious suggestion:
https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro.html
I would like to add that using warehouse instead of snowpipe will cause warehouse to open whole time ( if rule that minimum run time for warehouse is 1 min is stil in use ). Snowpipe should costs only runtime in seconds resolution.
Yes you are correct and I am using snowpipe which runs every 15 min to check modified file of last 15 mins to upload. Now looking for S3 event notification setup using object key name filtering.
Snowpipe has a serverless option now. It bills as part of GS, meaning it only gets billed if you exceed 10% of that day's overall credit consumption. This can help with the dreaded 'never suspending task warehouse' issue.
That is what i meant, someone from snowflake said that snowpipe usage is billed by second vs warehouse which is 1 minute everytime you start it, which leads easily into situation where you have warehouse open all the time.
100% correct. Happened to me, once. Left a task running every minute as a test, and forgot it. Came back to over 500 credits used up over the course of 4 days.
Make sure you set up Resource Monitors, hahaha
Snowpipe Serverless is billed per sec per core unlike Cloud Services where you are billed for usage over 10% of daily compute used.
https://docs.snowflake.com/en/user-guide/data-load-snowpipe-billing.html
You're right. I was definitely thinking of tasks. I even said 'task warehouse', haha