1.准备数据源
mysql中表bigdata,数据如下:
2. 准备目标表
目标表存放hive中数据库dw_stg表bigdata
保存路径为 hdfs://localhost:9000/user/hive/warehouse/dw_stg.db/bigdata
hive中建表语句如下:
create external table bigdata( class_id string comment '课程id', class_name string comment '课程名称', class_month int comment '课程周期', teacher string comment '课程老师', update_time string comment '更新日期' ) partitioned by(dt string comment '年月日') row format delimited fields terminated by '