1.访问星环客户端,下载TDH_Client压缩包
2.到该目录,解压压缩包,./init.sh
3.source init.sh
4.输入export HADOOP_USER_NAME=hdfs
5.导入oracle的驱动包到/opt/TDH_Client/sqoop/lib下
6.sqoop import –connect “jdbc:oracle:thin:@192.168.186.36:1521/ORCL” –username epoint –password 11111 –target-dir /data/sqoop/bo_user/CAR_HAILING2 -m 1 –query “select * from CAR_HAILING2 where $CONDITIONS” –fields-terminated-by “\001” –hive-drop-import-delims –null-string ‘\N’ –null-non-string ‘\N’ –outdir /tmp/sqoop_jar
7.create external table if not exists EX.ex_CAR_HAILING2 (TIME
STRING,PLATE_NUM STRING,
DETECTOR_NUM STRING
) row format DELIMITED FIELDS terminated by ‘\001’ stored as textfile location ‘/data/sqoop/bo_user/CAR_HAILING2’;
8.create table if not exists CAR_HAILING2 (TIME
STRING,PLATE_NUM STRING,
DETECTOR_NUM STRING
) clustered by (TIME
) into 250 buckets STORED AS ORC 每个桶大概200M,所以22G数据,设置110个桶,如果是ORC事务表,每个桶不超过100M,设置为250
9.INSERT INTO DEFAULT.CAR_HAILING2 SELECT * FROM ex.CAR_HAILING2