Skip to content

Instantly share code, notes, and snippets.

@saptak
Created July 17, 2017 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saptak/82ffbdb5d6b502f8b4c5167835c3b234 to your computer and use it in GitHub Desktop.
Save saptak/82ffbdb5d6b502f8b4c5167835c3b234 to your computer and use it in GitHub Desktop.
create database if not exists llap
location 's3a://<your_S3_bucket>/llap.db';
drop table if exists llap.customer;
create table llap.customer
stored as orc
as select * from tpch_text_2.customer;
drop table if exists llap.lineitem;
create table llap.lineitem
stored as orc
as select * from tpch_text_2.lineitem;
drop table if exists llap.nation;
create table llap.nation
stored as orc
as select * from tpch_text_2.nation;
drop table if exists llap.orders;
create table llap.orders
stored as orc
as select * from tpch_text_2.orders;
drop table if exists llap.part;
create table llap.part
stored as orc
as select * from tpch_text_2.part;
drop table if exists llap.partsupp;
create table llap.partsupp
stored as orc
as select * from tpch_text_2.partsupp;
drop table if exists llap.region;
create table llap.region
stored as orc
as select * from tpch_text_2.region;
drop table if exists llap.supplier;
create table llap.supplier
stored as orc
as select * from tpch_text_2.supplier;
analyze table llap.customer compute statistics for columns;
analyze table llap.lineitem compute statistics for columns;
analyze table llap.nation compute statistics for columns;
analyze table llap.orders compute statistics for columns;
analyze table llap.part compute statistics for columns;
analyze table llap.partsupp compute statistics for columns;
analyze table llap.region compute statistics for columns;
analyze table llap.supplier compute statistics for columns;
use llap;
msck repair table customer;
msck repair table lineitem;
msck repair table nation;
msck repair table orders;
msck repair table part;
msck repair table partsupp;
msck repair table region;
msck repair table supplier;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment