zoukankan      html  css  js  c++  java
  • sqoop常用命令记录

    sqoop从msyq导入数据到hive,自定建表

    sqoop import 
    --connect 'jdbc:mysql://xxx.xxx.xxx.xx:3306/database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL' 
    --username root
    --password 123456 
    --table student_info 
    --hive-import 
    --hive-drop-import-delims 
    --create-hive-table 
    --hive-database lods 
    --hive-table  lods_source_dxxbs_student_info 
    --fields-terminated-by "01" 
    --lines-terminated-by "
    " 
    -m 1

    注意:一定要添加 --hive-drop-import-delims 否则,mysql字段中包含 会导致数据错位

    sqoop导mysql数据到hive,覆盖hive已有数据

    /data/software/sqoop-1.4.7/bin/sqoop import 
    --connect "jdbc:mysql://xxx.xxx.xxx.xxx:3306/database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL"  
    --username root 
    --password 123456 
    --table student_info 
    --fields-terminated-by "01" 
    --hive-drop-import-delims 
    --lines-terminated-by "
    " 
    --hive-import 
    --hive-overwrite 
    --hive-database lods 
    -–create-hive-table 
    --hive-table lods_source_dxxbs_student_info 
    -m 1

     sqoop到出hive收据到mysql。且根据指定字段更新数据

     /data/software/sqoop-1.4.7/bin/sqoop export 
    --connect "jdbc:mysql://192.168.0.69:3306/interface_library?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL" 
    --username gxmanager 
    --password VItnc5IdF0#DV4VT 
    --table ldwd_basic_dxxbs_student_info_all 
    --export-dir /user/hive/warehouse/ldwd.db/ldwd_basic_dxxbs_student_info_all/ 
    --update-key student_key 
    --update-mode allowinsert 
    --input-fields-terminated-by '01' 
    --input-null-string 'null' 
    --input-null-non-string 'null' 
    -m 1
    author@nohert
  • 相关阅读:
    CSS 背景
    CSS padding 属性
    CSS border 属性和 border-collapse 属性
    CSS margin 属性
    IEnumerable<T> 接口和GetEnumerator 详解
    discuz! X3.4特殊字符乱码解决方案
    Discuz通过修改文章标题更好的实现SEO的方法
    关于Discuz x3.3页面空白解决方法
    discuz x3.3标题的最少字数限制设置方法
    discuz网站前端代码优化思路
  • 原文地址:https://www.cnblogs.com/gzgBlog/p/15013851.html
Copyright © 2011-2022 走看看