1、建表
drop table if exists tmp.dwd_acc_asset_account_df;
create table tmp.dwd_acc_asset_account_df as
select * from
dwd.dwd_acc_asset_account_df
where etl_date = 20230112 and 1=2
;
2、指定分隔符,同时使用GBK防止中文乱码
ALTER TABLE tmp.dm_pty_yzqh_term5_cust_info_df SET SERDEPROPERTIES (‘field.delim’ = ‘,’, ‘serialization.format’=‘,’,‘serialization.encoding’=‘GBK’);
3、导入数据(执行前对hdfs文件增加读写权限)
LOAD DATA INPATH ‘/user/guanglongkang/2-1-1-dm_pty_yzqh_term5_cust_info_df.csv’ overwrite INTO TABLE tmp.dm_pty_yzqh_term5_cust_info_df;