1、创建电影评分表

create table film_table
(
    userid int,
    movieid int,
    rating int,
    unixtime string
)
row format delimited
fields terminated by '\t'--使用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;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-19
  • 2021-09-10
  • 2021-12-29
  • 2022-02-11
  • 2022-01-24
  • 2022-03-02
  • 2022-12-23
相关资源
相似解决方案