美文网首页
Sqoop导入

Sqoop导入

作者: aijerry | 来源:发表于2020-11-05 16:02 被阅读0次
    /usr/local/datacenter/sqoop/bin/sqoop import --connect "jdbc:mysql://192.168.3.31:3306/db?useUnicode=true&characterEncoding=utf-8" --username *** --password ** \
    --query 'select uid, ip, url, method, replace(replace(replace(args, "\\", ""), "\"{", "{"), "}\"", "}"), cost, err_msg, ctime, raw_uid from sys_operate_log where ctime>="'${dt_from}'" and ctime<"'${dt_to}'" and 1=1 and $CONDITIONS UNION ALL select uid, "127.0.0.1" as ip, "xxx" as url, "POST" as method, query, 0 as cost, "" as err_msg, ctime, "60449743" as raw_uid from user_search_log where ctime>="'${dt_from}'" and ctime<"'${dt_to}'" and 1=1 and $CONDITIONS' \
    --hive-import \
    --hive-database hivedb \
    --hive-table zl_operate_log \
    --hive-drop-import-delims  \
    --hive-overwrite \
    --hive-partition-key dt \
    --hive-partition-value ${dt_partition} \
    --target-dir /user/hivedb/zl/zl_operate_log/${dt_partition} \
    --split-by 'ctime' \
    --num-mappers 3 \
    --mapreduce-job-name sync_t_zl_operate_log
    

    相关文章

      网友评论

          本文标题:Sqoop导入

          本文链接:https://www.haomeiwen.com/subject/kwqavktx.html