6. 数据迁移_项目一
数据导出,先创建表
create database project charset "utf8";
use project;
create table month_pvs(
visit_year varchar(20),
visit_month varchar(20),
pvs int
);
create table day_pvs(
visit_year varchar(20),
visit_month varchar(20),
visit_day varchar(20),
pvs int
);
create table hour_pvs(
visit_year varchar(20),
visit_month varchar(20),
visit_day varchar(20),
visit_hour varchar(20),
pvs int
);
create table area_pvs(
logdate varchar(20),
province varchar(20),
latitude varchar(20),
longitude varchar(20),
pvs int
);
create table age_pvs(
age_range varchar(20),
pvs int
);
数据导出,格式必须换行
[root@node1 dataExport]# cat dataexport.opt
export
--connect
"jdbc:mysql://node1:3306/project?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8"
--username
root
--password
Jsq123456...
--table
age_pvs
--num-mappers
1
--export-dir
"/user/hive/warehouse/project.db/age_pvs"
--input-fields-terminated-by
","
本文来自博客园,作者:jsqup,转载请注明原文链接:https://www.cnblogs.com/jsqup/p/16572152.html