文章目录
文章目录
Sqoop导出编码问题
在创建数据库时指定编码
mysql> CREATE DATABASE `otherdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
在建表时指定编码
create table use_02 (remark varchar(20),groupName varchar(225)) charset utf8 collate utf8_general_ci;
导入数据时在加入编码
sqoop export --connect "jdbc:mysql://master:3306/test?useUnicode=true&characterEncoding=utf-8" --username root --password 000000 --table movie_top --export-dir /user/hive/warehouse/test1.db/movie_top --fields-terminated-by "\t"