• +971 2 5509485
TotalX
  • Home
  • About Us
  • OUR SERVICES
  • Why TotalX
  • Safety and quality
  • Contact Us

Latest Blog

  • Uncategorized
  • 411
  • 0 Comments

Quick & Easy JSON Data Loading in Snowflake – Step by Step

One of Snowflake’s greatest strengths is how easily it can ingest data, regardless of format. In this article we’ll look at how we can easily send a large JSON file to a Snowflake stage, directly query the JSON data, and copy it into a table.

The instructions assume you have some familiarity with Snowflake already. We also make use of the SnowSQL CLI tool – you can find instructions on installing this here:

https://docs.snowflake.net/manuals/user-guide/snowsql-install-config.html

In a real situation we would take more care over the organisation and permissions of our database objects and user roles, but here we just want to show how easy it is to get started with semi-structured data.

Getting The Data

Bitcoin is over 10 years old and is often in the news, particularly when its price makes sudden large movements up or down. BitMEX is a popular Bitcoin derivatives exchange with comprehensive APIs. For this demonstration we’ll use some data about the Limit Order Book. Traders often look at the order book to help determine whether the price is likely to go up or down. With many traders using the exchange as well as algorithmic trading bots, the order book changes many times per second, generating a lot of data which is hard for humans to analyse. The Limit Order Book changes very frequently.

No alt text provided for this image

We used a simple NodeJS script and BitMEX’s own API reference connector to dump our JSON data to a file ready for loading. You can get the script and see a sample of the output data here: https://gist.github.com/taa-simon/02d2be4b7664ffce80b727f6586fd575

The JSON data is an array of objects (the orderbook snapshots). The objects have a timestamp property, and another property called ‘book’. The latter is an array of objects representing the total of the buy and sell orders at specific price levels. This nested structure could be fiddly to load into a two-dimensional table structure, but as we’ll see Snowflake makes it easy.

Creating Snowflake File Format and Stage objects

Loading data in Snowflake is done via stages and specified file formats. Make sure you have selected a database and schema to operate in, using USE statements.

Our file format tells Snowflake that the data is JSON and that it should remove the outer array of the data structure:

  • Facebook
  • Twitter
  • Google Plus
  • Pinterest
  • Linkedin

Write a comment Cancel reply

Recent Posts

  • How To Get Custom Essays Online At Affordable Price And Quickly Get The Writing You Want
  • Affordable Essay Writing Service
  • Improve Your Grades – Alter Custom Inventories
  • Why Cheap Essays Are Becoming Popular All Over The World
  • (no title)

Recent Comments

  • A WordPress Commenter on Hello world!
  • admin on Now You Can Have The idea Of Your Dreams

Archives

  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • September 2021
  • July 2021
  • June 2021
  • May 2021
  • February 2021
  • January 2021
  • September 2020
  • July 2020
  • June 2020
  • May 2020
  • March 2020
  • December 2016

Categories

  • Art
  • brides
  • dating sites
  • Fashion
  • filipina brides
  • Music
  • Photography
  • Technology
  • thai brides
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Ads

Popular Posts

VDRs: Adaptability and Protection

February 3, 2021

Now You Can Have The idea Of Your Dreams

December 26, 2016

January 31, 2022

Categories

  • Art (5)
  • brides (1)
  • dating sites (1)
  • Fashion (5)
  • filipina brides (1)
  • Music (6)
  • Photography (10)
  • Technology (7)
  • thai brides (1)
  • Uncategorized (30)
Ads

QUICK LINKS

  • Home
  • About Us
  • Our Services

  

  • Why TotalX
  • Safety and quality
  • Contact Us

Address

Total Expertise for Trading & Industrials Co. Ltd.
P.O Box 91219
Blue Lake Properties Compound
Warehouse B1501, ICAD 3, Mussafah
Abu Dhabi, U.A.E

Get in touch

Phone: +971 2 5655297
Email: info@totalx.ae 
Timing: Sun-Thu: 8am to 5pm

© 2020 totalx.ae. All Rights Reserved.
Scroll