Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.37 KB

File metadata and controls

43 lines (30 loc) · 1.37 KB

Load financial data

This tutorial uses real-time stock trade data, also known as tick data, from Twelve Data. A direct download link is provided below.

To ingest data into the tables that you created, you need to download the dataset and copy the data to your database.

  1. Download the real_time_stock_data.zip file. The file contains two .csv files; one with company information, and one with real-time stock trades for the past month. Download:

    [real_time_stock_data.zip](https://assets.timescale.com/docs/downloads/get-started/real_time_stock_data.zip)
  2. In a new terminal window, run this command to unzip the .csv files:

    unzip real_time_stock_data.zip
  3. At the psql prompt, use the COPY command to transfer data into your $SERVICE_LONG. If the .csv files aren't in your current directory, specify the file paths in these commands:

    \COPY stocks_real_time from './tutorial_sample_tick.csv' DELIMITER ',' CSV HEADER;
    \COPY company from './tutorial_sample_company.csv' DELIMITER ',' CSV HEADER;

    Because there are millions of rows of data, the COPY process could take a few minutes depending on your internet connection and local client resources.