blob: 027a556e898483b78a652112ea2484f3d8908b4b [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
drop dataverse tpcds if exists;
create dataverse tpcds;
use tpcds;
create type tpcds.customer_address_type as closed {
ca_address_sk : bigint,
ca_address_id : string,
ca_street_number : string?,
ca_street_name : string?,
ca_street_type : string?,
ca_suite_number : string?,
ca_city : string?,
ca_county : string?,
ca_state : string?,
ca_zip : string?,
ca_country : string?,
ca_gmt_offset : double?,
ca_location_type : string?
}
create type tpcds.web_sales_type as
closed {
ws_sold_date_sk : bigint?,
ws_sold_time_sk : bigint?,
ws_ship_date_sk : bigint?,
ws_item_sk : bigint,
ws_bill_customer_sk : bigint?,
ws_bill_cdemo_sk : bigint?,
ws_bill_hdemo_sk : bigint?,
ws_bill_addr_sk : bigint?,
ws_ship_customer_sk : bigint?,
ws_ship_cdemo_sk : bigint?,
ws_ship_hdemo_sk : bigint?,
ws_ship_addr_sk : bigint?,
ws_web_page_sk : bigint?,
ws_web_site_sk : bigint?,
ws_ship_mode_sk : bigint?,
ws_warehouse_sk : bigint?,
ws_promo_sk : bigint?,
ws_order_number : bigint,
ws_quantity : bigint?,
ws_wholesale_cost : double?,
ws_list_price : double?,
ws_sales_price : double?,
ws_ext_discount_amt : double?,
ws_ext_sales_price : double?,
ws_ext_wholesale_cost : double?,
ws_ext_list_price : double?,
ws_ext_tax : double?,
ws_coupon_amt : double?,
ws_ext_ship_cost : double?,
ws_net_paid : double?,
ws_net_paid_inc_tax : double?,
ws_net_paid_inc_ship : double?,
ws_net_paid_inc_ship_tax : double?,
ws_net_profit : double?
}
create type tpcds.date_dim_type as
closed {
d_date_sk : bigint,
d_date_id : string,
d_date : string?,
d_month_seq : bigint?,
d_week_seq : bigint?,
d_quarter_seq : bigint?,
d_year : bigint? ,
d_dow : bigint? ,
d_moy : bigint?,
d_dom : bigint?,
d_qoy : bigint?,
d_fy_year : bigint?,
d_fy_quarter_seq : bigint?,
d_fy_week_seq : bigint?,
d_day_name : string?,
d_quarter_name : string?,
d_holiday : string?,
d_weekend : string?,
d_following_holiday : string?,
d_first_dom : bigint?,
d_last_dom : bigint?,
d_same_day_ly : bigint?,
d_same_day_lq : bigint?,
d_current_day : string?,
d_current_week : string?,
d_current_month : string?,
d_current_quarter : string?,
d_current_year : string?
}
create type tpcds.web_returns_type as
closed {
wr_returned_date_sk : bigint?,
wr_returned_time_sk : bigint?,
wr_item_sk : bigint,
wr_refunded_customer_sk : bigint?,
wr_refunded_cdemo_sk : bigint?,
wr_refunded_hdemo_sk : bigint?,
wr_refunded_addr_sk : bigint?,
wr_returning_customer_sk : bigint?,
wr_returning_cdemo_sk : bigint?,
wr_returning_hdemo_sk : bigint?,
wr_returning_addr_sk : bigint?,
wr_web_page_sk : bigint?,
wr_reason_sk : bigint?,
wr_order_number : bigint,
wr_return_quantity : bigint?,
wr_return_amt : double?,
wr_return_tax : double?,
wr_return_amt_inc_tax : double?,
wr_fee : double?,
wr_return_ship_cost: double?,
wr_refunded_cash: double?,
wr_reversed_charge: double?,
wr_account_credit: double?,
wr_net_loss: double?
}
create type tpcds.web_site_type as
closed {
web_site_sk: bigint,
web_site_id: string,
web_rec_start_date: string?,
web_rec_end_date: string?,
web_name: string?,
web_open_date_sk: bigint?,
web_close_date_sk: bigint?,
web_class: string?,
web_manager: string?,
web_mkt_id: bigint?,
web_mkt_class: string?,
web_mkt_desc: string?,
web_market_manager: string?,
web_company_id: bigint?,
web_company_name: string?,
web_street_number: string?,
web_street_name: string?,
web_street_type: string?,
web_suite_number: string?,
web_city: string?,
web_county: string?,
web_state: string?,
web_zip: string?,
web_country: string?,
web_gmt_offset: double?,
web_tax_percentage: double?
}
create dataset customer_address(customer_address_type) primary key ca_address_sk;
create dataset web_sales (web_sales_type) primary key ws_item_sk, ws_order_number;
create dataset date_dim(date_dim_type) primary key d_date_sk;
create dataset web_returns (web_returns_type) primary key wr_item_sk, wr_order_number;
create dataset web_site (web_site_type) primary key web_site_sk;