Member-only story

How to Import Data into Snowflake via JavaScript Node JS? (Part 1: csv & Excel)

DigNo Ape
5 min readJan 18, 2023

--

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 =…

--

--

DigNo Ape
DigNo Ape

Written by DigNo Ape

我們秉持著從原人進化的精神,不斷追求智慧的累積和工具的運用來提升生產力。我們相信,每一個成員都擁有無限的潛力,透過學習和實踐,不斷成長和進步。

No responses yet