Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (24 sloc) 838 Bytes
CREATE TABLE logs (ts BIGINT, line STRING)
PARTITIONED BY (dt STRING, country STRING);
LOAD DATA LOCAL INPATH 'input/hive/partitions/file1'
INTO TABLE logs
PARTITION (dt='2001-01-01', country='GB');
LOAD DATA LOCAL INPATH 'input/hive/partitions/file2'
INTO TABLE logs
PARTITION (dt='2001-01-01', country='GB');
LOAD DATA LOCAL INPATH 'input/hive/partitions/file3'
INTO TABLE logs
PARTITION (dt='2001-01-01', country='US');
LOAD DATA LOCAL INPATH 'input/hive/partitions/file4'
INTO TABLE logs
PARTITION (dt='2001-01-02', country='GB');
LOAD DATA LOCAL INPATH 'input/hive/partitions/file5'
INTO TABLE logs
PARTITION (dt='2001-01-02', country='US');
LOAD DATA LOCAL INPATH 'input/hive/partitions/file6'
INTO TABLE logs
PARTITION (dt='2001-01-02', country='US');
SHOW PARTITIONS logs;
SELECT ts, dt, line
FROM logs
WHERE country='GB';
Something went wrong with that request. Please try again.