前言
1.创建wordcount数据库
hive> create database wordcount;
OK
Time taken: 2.313 seconds
hive> show databases;
OK
default
wordcount
Time taken: 0.926 seconds, Fetched: 2 row(s)
2.创建表
官方的Tutorial给出一个建表的范例,更多细节可以查看:Hive Tutorial
CREATE TABLE page_view(viewTime INT, userid BIGINT,
page_url STRING, referrer_url STRING,
ip STRING COMMENT 'IP Address of the User')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '1'
COMMENT 'This is the page view table'
PARTITIONED BY(dt STRING, country STRING)
STORED AS SEQUENCEFILE;