Hive QL的实例

1、创建电影评分表

create table film_table
(
    userid int,
    movieid int,
    rating int,
    unixtime string
)
row format delimited
fields terminated by '	'--使用tab空格定义文本格式
stored as textfile;

2、下载数据文本文件,并解压

wget http://www.grouplens.org/system/files/ml-data.tar.gz
tar xvzf ml-data.tar.gz

3、将文件加载到表中

load data local inpath 'ml-data/film.data'
overwrite into table film_table;
count the number of rows in table film_table;
select count(*) from film_table;
原文地址:https://www.cnblogs.com/drq1/p/9173745.html