SNOW-SQL in SNOWFLAKE
SNOW-SQL in SNOWFLAKE
Published: None
SNOW-SQL in SNOWFLAKE
SnowSQL is a command-line tool designed by Snowflake to interact with Snowflake databases. It allows users to execute SQL queries, perform data loading and unloading, and manage database objects
What will it covered
- How can we upload files if a folder has space? How can we check/query stage data?
- How can I upload only selected files? How to load files from Snowflake to a local stage?
- How can I copy files from one stage to another stage? How to load files in stages?
- How can I remove files from stages?
- PUT & GET command (SNOWSQL) through CLI. How can we check all files from stages?
- Can we apply any transformation on stage data?
Advantages:
- Scalability: Easily scale compute resources to handle large data volumes.
- Multi-cloud Support: Operate across different cloud providers.
- Simplified Management: Streamline data analysis with a user-friendly interface.
- Performance: Optimize queries with Snowflake's architecture.
- Security: Robust features like access management and encryption.
- Ease of Use: SQL familiarity reduces learning curve.
Challenges:
- Cost: Pay-per-use model may lead to higher expenses.
- Learning Curve: Understanding Snowflake’s architecture requires effort.
- Performance: Complex queries might cause bottlenecks.
- Migration: Moving large data volumes needs planning.
--Warehouse created
CREATE OR REPLACE WAREHOUSE LRN
---Create database
CREATE OR REPLACE DATABASE LRN_DB
- Loading the data from local to stage
- Checking the stages
- Suppose the file which was already uploaded to stage- Later same file got modified & you want to reload it -will only load the added or modified data to stages
- In case we want to upload all the csv files that are stored in that folder to the stages
- Check the data from a particular files that are uploaded to the stages
- Remove a particular file from the stage
- Check the files under the satges
- Now we will copy the data from one stage to another stage
- Create a stage by default will be file format as CSV
- Now we will copy all the files from STAGE_CSV to OD01_STAGE
- Check the files that are copied to OD01_STAGE;
- Remove all the files from the stages;
- Copy all the sample data to OD01_STAGE
- Download the files from Stage to local directory
- Apply different types of transformation of data on the top of staged files
Declartion: The views and opinions expressed in this presentation are those of the author and do not necessarily reflect the official policy or position of Novartis or any of its affiliates or officers
Reference:
https://www.youtube.com/watch?v=DuowRboOWAI&list=PL__gObEGy1Y7klsW7vc2TM2Cmt6BwRkzh&index=13
Comments
Post a Comment