MARKET_DATA_SETS

The MARKET_DATA_SETS table is used to provide available market data sets.

Column Name Type Not Null Default Value1 Description
AS_OF_DATE DATE Y Timestamp (at close of business) for the data.
MARKET_DATA_SET STRING Y N/A String defining the market data set, for example “Trader marks” or “Official EOD”.

Unique Key

Columns
AS_OF_DATE
MARKET_DATA_SET

Table creation script

Snowflake

Table creation

create OR REPLACE table MARKET_DATA_SETS(
	AS_OF_DATE DATE NOT NULL,
	MARKET_DATA_SET STRING NOT NULL DEFAULT 'N/A',
	primary key (AS_OF_DATE, MARKET_DATA_SET)
);

Table population from files (optional)

If you want to populate the table from CSV files, you can run the following scripts (this example assumes that you want to load the files MarketDataSets.csv present in the folders 2023-09-26, 2023-09-27 and 2023-09-28):

create OR REPLACE stage MR_INPUT_RAW;

create OR REPLACE file format CSV_GZIP TYPE = CSV COMPRESSION = GZIP SKIP_HEADER = 1 comment = 'File format to import MR data';

create OR REPLACE file format CSV_FORMAT TYPE = CSV COMPRESSION = AUTO SKIP_HEADER = 1 comment = 'File format to import MR data';

PUT file://<full path to you data folder>/2023-09-26/MarketDataSets.csv @MR_INPUT_RAW/2023-09-26; PUT file://<full path to you data folder>/2023-09-27/MarketDataSets.csv @MR_INPUT_RAW/2023-09-27; PUT file://<full path to you data folder>/2023-09-28/MarketDataSets.csv @MR_INPUT_RAW/2023-09-28;

copy into MARKET_DATA_SETS from @MR_INPUT_RAW pattern='./MarketDataSets..csv.gz' FILE_FORMAT = CSV_GZIP;


  1. If the default value is marked as empty, it means that the default value is 'null' for nullable fields, and that a value needs to be explicitly set for non-nullable fields.  ↩︎