File size: 2,872 Bytes
37bd4dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
__all__ = ["SCHEMA_NAME", "GPT_SAMPLE_ROWS", "PLATFORM", "SAMPLE_ROW_MAX", "DEFAULT_TABLES_COLS", "QUERY_TIMEOUT"]

#Constants
SCHEMA_NAME = "lpdatamart"
GPT_SAMPLE_ROWS = 5
PLATFORM = "Amazon Redshift"
SAMPLE_ROW_MAX = 50
QUERY_TIMEOUT = 20 #timeout in seconds


# list down the desired column

customer_col=['customer_id','customer_type', 'first_name', 'middle_name', 'household_name', 'last_name', 'personal_email', 'city', 'state', 'zip_code', 'address1', 'country', 'gender', 'phone_number', 'reward_number']
product_col=['product_id', 'product_name', 'product_price', 'department', 'class',  'discount', 'category', 'department_desc', 'department_type', 'product_type', 'manufacturer', 'color']
sales_col = ['store_id', 'customer_id', 'channel_id', 'product_id', 'time_id', 'date_id','order_id', 'line_action', 'discount_amount', 'shipping_amount','transaction_date', 'transaction_amount', 'transaction_type', 'qty_sold']
store_col = ['store_id', 'store_number', 'store_name', 'store_designation', 'store_longitude', 'store_latitude', 'store_manager_name', 'zip_code', 'state_code', 'city', 'street_number', 'street_name', 'store_region', 'store_type', 'address1','sublocationcode', 'channel', 'company_flag', 'kiosk_physical_store', 'sublocation_code']
channel_col = ['channel_id', 'channel_name', 'channel_code']
lineaction_col = ['line_action_code', 'line_action_code_desc', 'load_date', 'catgory', 'sales_type']
calendar_col = ['date_id','calendar_date','calendar_month','day_of_week','calendar_week_number','calendar_month_number','calendar_quarter_number','day_of_month','day_of_quarter','day_of_the_year','us_holiday','lp_holiday','work_day','year','ad_week','ad_week_year','ad_month','lp_day','lp_week','lp_month','lp_year','lp_quarter','event_day']

browse_col = ['cookie_id', 'session_id', 'customer_id', 'email_key', 'reward_number', 'date_id', 'time_id', 'category_id', 'browse_action_id', 'product_id', 'style_id', 'order_id']
time_col = ['time_id', 'time_of_day']
browse_action_col = ["browse_action_id", "browse_action"]
browse_category_col = ['category_id', 'category_code', 'category']
style_col = ["sku", "style", "source_file", "load_date"]
email_col = ['event_id', 'customer_id', 'time_id', 'date_id', 'email_key']
event_col = ['event_id', 'event_type', 'event_description', 'event_detail', 'start_date', 'end_date', 'event_code', 'event_category']


DEFAULT_TABLES_COLS = {"tbl_d_customer":customer_col, "tbl_d_product":product_col, "tbl_f_sales":sales_col,
          "tbl_d_store":store_col, "tbl_d_channel":channel_col, "tbl_d_lineaction_code":lineaction_col,
                  "tbl_d_calendar":calendar_col, 'tbl_f_browse':browse_col, 'tbl_d_time': time_col, 'tbl_d_browse_action': browse_action_col,
                  'tbl_d_browse_category':browse_category_col, 'tbl_d_style':style_col, 'tbl_f_emailing': email_col, 'tbl_d_event':event_col}