10.4训练

输入schematool -initSchema -dbType mysql -verbose初始化hive元数据库

hive建表

create table test0 (
day_id string,
sale_nbr string,
buy_nbr string,
cnt int,
round double
)
ROW format delimited fields terminated by ',' STORED AS TEXTFILE;
导入文件
hadoop fs -put /opt/software/sales.csv /user/hive/warehouse/test0导入sales.csv文件;
清洗数据
insert overwrite table test0
select date_add('2021-09-00',cast(day_id as int)) as day_id,
sale_nbr as sale_nbr,
buy_nbr as buy_nbr,
cnt as cnt,
round as round
from test0;
posted @ 2022-10-04 18:08  lss1226  阅读(28)  评论(0)    收藏  举报