下面是极限测试的要求与我的操作步骤和流程:
要求:
我的处理步骤:
先打开三台虚拟机:
然后用xshell连接:
打开dfs
开启hive的两个服务:
进入hive:
在hive里面建表:
createtabletest0(day_idstring,sale_nbrstring,buy_nbrstring,cntstring,roundstring)ROWformatdelimitedfieldsterminatedby','STOREDASTEXTFILE;
导入数据:
loaddatalocalinpath'/opt/software/sale.csv'intotabletest0;
然后进行清洗:把日期清洗成标准格式:
insertoverwritetabletest0selectdate_add('2021-09-00',cast(day_idasint))asday_id,sale_nbrassale_nbr,buy_nbrasbuy_nbr,cntascnt,roundasroundfromtest0;
导出:
bin/sqoopexport\--connectjdbc:mysql://192.168.10.102:3306/user\--usernameroot\--password123456\--tablewenti7\--num-mappers1\--export-dir/user/hive/warehouse/dao1\--input-fields-terminated-by","
THE END