mysql 导出数据
mysql -uuser -hhost -ppws -C -N -e "select * from bi_datacenter.dc_behavior limit 0,20000000" >behavor1
load data local inpath '/home/hadoop/a' into table dc_behavior_tab;
不过hive里的表要建为
CREATE TABLE `dc_behavior_tab`(
`id` bigint,
`ip` string,
`uid` string,
`submittime` string,
`serviceid` string,
`data` string,
`responsetime` string,
`responsestatus` int,
`updatetime` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
hive 默认 FIELDS TERMINATED BY 是'\u0001'