How to Import Data into Snowflake via JavaScript Node JS? (Part 1: csv & Excel)
Snowflake Inc. is a cloud computing-based data warehousing company that offers a cloud-based data storage and analytics service, generally termed “data warehouse-as-a-service”. It allows corporate users to store and analyze data using cloud-based hardware and software. (Wiki)
You have to manipulate the data resides in multiple platforms when you do the data analysis, machine learning, reporting, etc. We are going to discuss multiple approaches of leveraging JavaScript Node JS to upload the data in csv file and MS Excel into Snowflake.
csv into Snowflake (Method 1)
- Required package: snowflake-sdk / csv-parse / fs
- Steps:
Step 0: Create a destination table called DB.SCHEMA.Newegg in Snowflake.
Step 1: Define SF connction.
Step 2: Read the csv file and parse it to get the data.
Step 3: For each row (from line 2), run the query to insert require columns.
Step 4: Inside the bracket of execution, define SQL scripts, parameters and completion/ error messages.
- Run the node import_data_into_sf_csv_1
- Full JS codes:
const snowflake =…