· 6 years ago · Sep 15, 2019, 02:24 PM
1CREATE DATABASE IF NOT EXISTS winecellarpq
2 COMMENT 'wine-cellar-parquet'
3 LOCATION 's3://cmm-wine-cellar/pqdb/'
4 WITH DBPROPERTIES ('creator'='Carlos Martins', 'Dept.'='Cloud');
5
6CREATE EXTERNAL TABLE IF NOT EXISTS winecellarpq.pqfirst150 (
7 `country` string,
8 `description` string,
9 `designation` string,
10 `points` string,
11 `price` double,
12 `province` string,
13 `region_1` string,
14 `region_2` string,
15 `variety` string,
16 `winery` string
17)
18STORED AS PARQUET
19LOCATION 's3://cmm-wine-cellar/parquet/pq_winemag-data_first150k.csv/'
20tblproperties ("parquet.compress"="SNAPPY");
21
22select * from winecellarpq.pqfirst150;