orders.sql 637 B

12345678910111213141516171819202122232425262728293031323334
  1. create database if not exists ${DB};
  2. use ${DB};
  3. drop table if exists orders;
  4. create table orders (O_ORDERKEY BIGINT,
  5. O_CUSTKEY BIGINT,
  6. O_ORDERSTATUS STRING,
  7. O_TOTALPRICE DOUBLE,
  8. O_ORDERPRIORITY STRING,
  9. O_CLERK STRING,
  10. O_SHIPPRIORITY INT,
  11. O_COMMENT STRING)
  12. partitioned by (O_ORDERDATE STRING)
  13. stored as ${FILE}
  14. ;
  15. ALTER TABLE orders SET TBLPROPERTIES('orc.bloom.filter.columns'='*','orc.compress'='ZLIB');
  16. INSERT OVERWRITE TABLE orders partition(O_ORDERDATE)
  17. select
  18. O_ORDERKEY ,
  19. O_CUSTKEY ,
  20. O_ORDERSTATUS ,
  21. O_TOTALPRICE ,
  22. O_ORDERPRIORITY ,
  23. O_CLERK ,
  24. O_SHIPPRIORITY ,
  25. O_COMMENT,
  26. O_ORDERDATE
  27. from ${SOURCE}.orders
  28. ;