web_sales.sql 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. set hive.enforce.bucketing=true;
  2. set hive.exec.dynamic.partition.mode=nonstrict;
  3. set hive.exec.max.dynamic.partitions.pernode=4096;
  4. set mapred.job.reduce.input.buffer.percent=0.0;
  5. create database if not exists ${DB};
  6. use ${DB};
  7. drop table if exists web_sales;
  8. create table web_sales
  9. (
  10. ws_sold_date_sk int,
  11. ws_sold_time_sk int,
  12. ws_ship_date_sk int,
  13. ws_item_sk int,
  14. ws_bill_customer_sk int,
  15. ws_bill_cdemo_sk int,
  16. ws_bill_hdemo_sk int,
  17. ws_bill_addr_sk int,
  18. ws_ship_customer_sk int,
  19. ws_ship_cdemo_sk int,
  20. ws_ship_hdemo_sk int,
  21. ws_ship_addr_sk int,
  22. ws_web_page_sk int,
  23. ws_web_site_sk int,
  24. ws_ship_mode_sk int,
  25. ws_warehouse_sk int,
  26. ws_promo_sk int,
  27. ws_order_number int,
  28. ws_quantity int,
  29. ws_wholesale_cost float,
  30. ws_list_price float,
  31. ws_sales_price float,
  32. ws_ext_discount_amt float,
  33. ws_ext_sales_price float,
  34. ws_ext_wholesale_cost float,
  35. ws_ext_list_price float,
  36. ws_ext_tax float,
  37. ws_coupon_amt float,
  38. ws_ext_ship_cost float,
  39. ws_net_paid float,
  40. ws_net_paid_inc_tax float,
  41. ws_net_paid_inc_ship float,
  42. ws_net_paid_inc_ship_tax float,
  43. ws_net_profit float
  44. )
  45. partitioned by (ws_sold_date string)
  46. row format serde '${SERDE}'
  47. stored as ${FILE};