1 下载指定位置的数据
下载附件中的数据文件【任务 3 清洗后的数据.zip】,解压,使用 SFTP 相关工具将数据传至
slave2 服务器的/home 目录下
2 使用 Hadoopshell 命令创建目录/data/
Hadoop fs –mkdir /data
3 上传数据至 HDFS 的/data 目录下
使用命令:hadoop fs –put /home/任务 3 清洗后的数据 /data/
4 Hive 创建数据库
Create database db_phone_raw_3;
5 Hive 创建表
5.1 原始数据表
Create table tbl_phone_data_3(fld_phone_os string, fld_Phone_cpu string, fld_phone_ram string,
fld_phone_rom string) row format delimited fields terminated by '|';
5.2 手机 RAM 销售量统计表
Create table tbl_sales_ram_count (fld_ram_name string, fld_sale_count int);
5.3 手机操作系统统计表
Create table tbl_sales_os_count(fld_os_name string,fld_sale_count int);
5.4 手机 CPU 销售量统计表
Create table tbl_sales_cpu_count(fld_cpu_name string, fld_sale_count int);
5.5 手机 ROM 销售量统计表
Create table tbl_sales_rom_count(fld_rom_name string,fld_sale_count int);
评论0