Browse Source

Treat inventory as a dimension table

Gopal V 7 years ago
parent
commit
ac6440659a
1 changed files with 4 additions and 15 deletions
  1. 4 15
      ddl-tpcds/bin_partitioned/inventory.sql

+ 4 - 15
ddl-tpcds/bin_partitioned/inventory.sql

@@ -4,18 +4,7 @@ use ${DB};
 drop table if exists inventory;
 
 create table inventory
-(
-    inv_item_sk          bigint,
-    inv_warehouse_sk		bigint,
-    inv_quantity_on_hand	int
-)
-partitioned by (inv_date_sk bigint)
-stored as ${FILE};
-
-insert overwrite table inventory partition (inv_date_sk)
-select
-	i.inv_item_sk,
-	i.inv_warehouse_sk,
-	i.inv_quantity_on_hand,
-	i.inv_date_sk
-  from ${SOURCE}.inventory i;
+stored as ${FILE}
+as select * from ${SOURCE}.inventory
+CLUSTER BY inv_date_sk
+;