Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds initial TPCDS scripts for Fabric #184

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CREATE TABLE call_center
(
CC_CALL_CENTER_SK int,
CC_CALL_CENTER_ID char(16),
CC_REC_START_DATE date,
CC_REC_END_DATE date,
CC_CLOSED_DATE_SK int,
CC_OPEN_DATE_SK int,
CC_NAME varchar(50),
CC_CLASS varchar(50),
CC_EMPLOYEES int,
CC_SQ_FT int,
CC_HOURS char(20),
CC_MANAGER varchar(40),
CC_MKT_ID int,
CC_MKT_CLASS char(50),
CC_MKT_DESC varchar(100),
CC_MARKET_MANAGER varchar(40),
CC_DIVISION int,
CC_DIVISION_NAME varchar(50),
CC_COMPANY int,
CC_COMPANY_NAME char(50),
CC_STREET_NUMBER char(10),
CC_STREET_NAME varchar(60),
CC_STREET_TYPE char(15),
CC_SUITE_NUMBER char(10),
CC_CITY varchar(60),
CC_COUNTY varchar(30),
CC_STATE char(2),
CC_ZIP char(10),
CC_COUNTRY varchar(20),
CC_GMT_OFFSET decimal(5,2),
CC_TAX_PERCENTAGE decimal(5,2)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE catalog_page
(
CP_CATALOG_PAGE_SK int,
CP_CATALOG_PAGE_ID char(16),
CP_START_DATE_SK int,
CP_END_DATE_SK int,
CP_DEPARTMENT varchar(50),
CP_CATALOG_NUMBER int,
CP_CATALOG_PAGE_NUMBER int,
CP_DESCRIPTION varchar(100),
CP_TYPE varchar(100)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE catalog_returns
(
CR_RETURNED_DATE_SK int,
CR_RETURNED_TIME_SK int,
CR_ITEM_SK int,
CR_REFUNDED_CUSTOMER_SK int,
CR_REFUNDED_CDEMO_SK int,
CR_REFUNDED_HDEMO_SK int,
CR_REFUNDED_ADDR_SK int,
CR_RETURNING_CUSTOMER_SK int,
CR_RETURNING_CDEMO_SK int,
CR_RETURNING_HDEMO_SK int,
CR_RETURNING_ADDR_SK int,
CR_CALL_CENTER_SK int,
CR_CATALOG_PAGE_SK int,
CR_SHIP_MODE_SK int,
CR_WAREHOUSE_SK int,
CR_REASON_SK int,
CR_ORDER_NUMBER bigint,
CR_RETURN_QUANTITY int,
CR_RETURN_AMOUNT decimal(7,2),
CR_RETURN_TAX decimal(7,2),
CR_RETURN_AMT_INC_TAX decimal(7,2),
CR_FEE decimal(7,2),
CR_RETURN_SHIP_COST decimal(7,2),
CR_REFUNDED_CASH decimal(7,2),
CR_REVERSED_CHARGE decimal(7,2),
CR_STORE_CREDIT decimal(7,2),
CR_NET_LOSS decimal(7,2)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CREATE TABLE catalog_sales
(
CS_SOLD_DATE_SK int,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation?

CS_SOLD_TIME_SK int,
CS_SHIP_DATE_SK int,
CS_BILL_CUSTOMER_SK int,
CS_BILL_CDEMO_SK int,
CS_BILL_HDEMO_SK int,
CS_BILL_ADDR_SK int,
CS_SHIP_CUSTOMER_SK int,
CS_SHIP_CDEMO_SK int,
CS_SHIP_HDEMO_SK int,
CS_SHIP_ADDR_SK int,
CS_CALL_CENTER_SK int,
CS_CATALOG_PAGE_SK int,
CS_SHIP_MODE_SK int,
CS_WAREHOUSE_SK int,
CS_ITEM_SK int,
CS_PROMO_SK int,
CS_ORDER_NUMBER bigint,
CS_QUANTITY int,
CS_WHOLESALE_COST decimal(7,2),
CS_LIST_PRICE decimal(7,2),
CS_SALES_PRICE decimal(7,2),
CS_EXT_DISCOUNT_AMT decimal(7,2),
CS_EXT_SALES_PRICE decimal(7,2),
CS_EXT_WHOLESALE_COST decimal(7,2),
CS_EXT_LIST_PRICE decimal(7,2),
CS_EXT_TAX decimal(7,2),
CS_COUPON_AMT decimal(7,2),
CS_EXT_SHIP_COST decimal(7,2),
CS_NET_PAID decimal(7,2),
CS_NET_PAID_INC_TAX decimal(7,2),
CS_NET_PAID_INC_SHIP decimal(7,2),
CS_NET_PAID_INC_SHIP_TAX decimal(7,2),
CS_NET_PROFIT decimal(7,2)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE TABLE customer
(
C_CUSTOMER_SK int,
C_CUSTOMER_ID char(16),
C_CURRENT_CDEMO_SK int,
C_CURRENT_HDEMO_SK int,
C_CURRENT_ADDR_SK int,
C_FIRST_SHIPTO_DATE_SK int,
C_FIRST_SALES_DATE_SK int,
C_SALUTATION char(10),
C_FIRST_NAME char(20),
C_LAST_NAME char(30),
C_PREFERRED_CUST_FLAG char(1),
C_BIRTH_DAY int,
C_BIRTH_MONTH int,
C_BIRTH_YEAR int,
C_BIRTH_COUNTRY varchar(20),
C_LOGIN char(13),
C_EMAIL_ADDRESS char(50),
C_LAST_REVIEW_DATE_SK varchar(10)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE customer_address
(
CA_ADDRESS_SK int,
CA_ADDRESS_ID char(16),
CA_STREET_NUMBER char(10),
CA_STREET_NAME varchar(60),
CA_STREET_TYPE char(15),
CA_SUITE_NUMBER char(10),
CA_CITY varchar(60),
CA_COUNTY varchar(30),
CA_STATE char(2),
CA_ZIP char(10),
CA_COUNTRY varchar(20),
CA_GMT_OFFSET decimal(5,2),
CA_LOCATION_TYPE char(20)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE customer_demographics
(
CD_DEMO_SK int,
CD_GENDER char(1),
CD_MARITAL_STATUS char(1),
CD_EDUCATION_STATUS char(20),
CD_PURCHASE_ESTIMATE int,
CD_CREDIT_RATING char(10),
CD_DEP_COUNT int,
CD_DEP_EMPLOYED_COUNT int,
CD_DEP_COLLEGE_COUNT int
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
CREATE TABLE date_dim
(
D_DATE_SK int,
D_DATE_ID char(16),
D_DATE date,
D_MONTH_SEQ int,
D_WEEK_SEQ int,
D_QUARTER_SEQ int,
D_YEAR int,
D_DOW int,
D_MOY int,
D_DOM int,
D_QOY int,
D_FY_YEAR int,
D_FY_QUARTER_SEQ int,
D_FY_WEEK_SEQ int,
D_DAY_NAME char(9),
D_QUARTER_NAME char(6),
D_HOLIDAY char(1),
D_WEEKEND char(1),
D_FOLLOWING_HOLIDAY char(1),
D_FIRST_DOM int,
D_LAST_DOM int,
D_SAME_DAY_LY int,
D_SAME_DAY_LQ int,
D_CURRENT_DAY char(1),
D_CURRENT_WEEK char(1),
D_CURRENT_MONTH char(1),
D_CURRENT_QUARTER char(1),
D_CURRENT_YEAR char(1)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE household_demographics
(
HD_DEMO_SK int,
HD_INCOME_BAND_SK int,
HD_BUY_POTENTIAL char(15),
HD_DEP_COUNT int,
HD_VEHICLE_COUNT int
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE income_band
(
IB_INCOME_BAND_SK int,
IB_LOWER_BOUND int,
IB_UPPER_BOUND int
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE inventory
(
INV_DATE_SK int,
INV_ITEM_SK int,
INV_WAREHOUSE_SK int,
INV_QUANTITY_ON_HAND int
);
25 changes: 25 additions & 0 deletions src/main/resources/scripts/tpcds/build/fabric/1_create_item.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CREATE TABLE item
(
I_ITEM_SK int,
I_ITEM_ID char(16),
I_REC_START_DATE date,
I_REC_END_DATE date,
I_ITEM_DESC varchar(200),
I_CURRENT_PRICE decimal(7,2),
I_WHOLESALE_COST decimal(7,2),
I_BRAND_ID int,
I_BRAND char(50),
I_CLASS_ID int,
I_CLASS char(50),
I_CATEGORY_ID int,
I_CATEGORY char(50),
I_MANUFACT_ID int,
I_MANUFACT char(50),
I_SIZE char(20),
I_FORMULATION char(20),
I_COLOR char(20),
I_UNITS char(10),
I_CONTAINER char(10),
I_MANAGER_ID int,
I_PRODUCT_NAME char(50)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TABLE promotion
(
P_PROMO_SK int,
P_PROMO_ID char(16),
P_START_DATE_SK int,
P_END_DATE_SK int,
P_ITEM_SK int,
P_COST decimal(15,2),
P_RESPONSE_TARGET int,
P_PROMO_NAME char(50),
P_CHANNEL_DMAIL char(1),
P_CHANNEL_EMAIL char(1),
P_CHANNEL_CATALOG char(1),
P_CHANNEL_TV char(1),
P_CHANNEL_RADIO char(1),
P_CHANNEL_PRESS char(1),
P_CHANNEL_EVENT char(1),
P_CHANNEL_DEMO char(1),
P_CHANNEL_DETAILS varchar(100),
P_PURPOSE char(15),
P_DISCOUNT_ACTIVE char(1)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE reason
(
R_REASON_SK int,
R_REASON_ID char(16),
R_REASON_DESC char(100)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE ship_mode
(
SM_SHIP_MODE_SK int,
SM_SHIP_MODE_ID char(16),
SM_TYPE char(30),
SM_CODE char(10),
SM_CARRIER char(20),
SM_CONTRACT char(20)
);
32 changes: 32 additions & 0 deletions src/main/resources/scripts/tpcds/build/fabric/1_create_store.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CREATE TABLE store
(
S_STORE_SK int,
S_STORE_ID char(16),
S_REC_START_DATE date,
S_REC_END_DATE date,
S_CLOSED_DATE_SK int,
S_STORE_NAME varchar(50),
S_NUMBER_EMPLOYEES int,
S_FLOOR_SPACE int,
S_HOURS char(20),
S_MANAGER varchar(40),
S_MARKET_ID int,
S_GEOGRAPHY_CLASS varchar(100),
S_MARKET_DESC varchar(100),
S_MARKET_MANAGER varchar(40),
S_DIVISION_ID int,
S_DIVISION_NAME varchar(50),
S_COMPANY_ID int,
S_COMPANY_NAME varchar(50),
S_STREET_NUMBER varchar(10),
S_STREET_NAME varchar(60),
S_STREET_TYPE char(15),
S_SUITE_NUMBER char(10),
S_CITY varchar(60),
S_COUNTY varchar(30),
S_STATE char(2),
S_ZIP char(10),
S_COUNTRY varchar(20),
S_GMT_OFFSET decimal(5,2),
S_TAX_PRECENTAGE decimal(5,2)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CREATE TABLE store_returns
(
SR_RETURNED_DATE_SK int,
SR_RETURN_TIME_SK int,
SR_ITEM_SK int,
SR_CUSTOMER_SK int,
SR_CDEMO_SK int,
SR_HDEMO_SK int,
SR_ADDR_SK int,
SR_STORE_SK int,
SR_REASON_SK int,
SR_TICKET_NUMBER int,
SR_RETURN_QUANTITY int,
SR_RETURN_AMT decimal(7,2),
SR_RETURN_TAX decimal(7,2),
SR_RETURN_AMT_INC_TAX decimal(7,2),
SR_FEE decimal(7,2),
SR_RETURN_SHIP_COST decimal(7,2),
SR_REFUNDED_CASH decimal(7,2),
SR_REVERSED_CHARGE decimal(7,2),
SR_STORE_CREDIT decimal(7,2),
SR_NET_LOSS decimal(7,2)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE store_sales
(
SS_SOLD_DATE_SK int,
SS_SOLD_TIME_SK int,
SS_ITEM_SK int,
SS_CUSTOMER_SK int,
SS_CDEMO_SK int,
SS_HDEMO_SK int,
SS_ADDR_SK int,
SS_STORE_SK int,
SS_PROMO_SK int,
SS_TICKET_NUMBER int,
SS_QUANTITY int,
SS_WHOLESALE_COST decimal(7, 2),
SS_LIST_PRICE decimal(7, 2),
SS_SALES_PRICE decimal(7, 2),
SS_EXT_DISCOUNT_AMT decimal(7, 2),
SS_EXT_SALES_PRICE decimal(7, 2),
SS_EXT_WHOLESALE_COST decimal(7, 2),
SS_EXT_LIST_PRICE decimal(7, 2),
SS_EXT_TAX decimal(7, 2),
SS_COUPON_AMT decimal(7, 2),
SS_NET_PAID decimal(7, 2),
SS_NET_PAID_INC_TAX decimal(7, 2),
SS_NET_PROFIT decimal(7, 2)
);
Loading
Loading