大数据知识面试题-Sqoop(2022版)

序列号内容链接
1大数据知识面试题-通用(2022版)https://blog.csdn.net/qq_43061290/article/details/124819089
2大数据知识面试题-Hadoop(2022版)https://blog.csdn.net/qq_43061290/article/details/124822293
3大数据知识面试题-MapReduce和yarn(2022版)https://blog.csdn.net/qq_43061290/article/details/124841929
4大数据知识面试题-Zookeepr (2022版)https://blog.csdn.net/qq_43061290/article/details/124548428
5大数据知识面试题-Hive (2022版)https://blog.csdn.net/qq_43061290/article/details/125105485
6大数据知识面试题-Flume(2022版)https://blog.csdn.net/qq_43061290/article/details/125132610
7大数据知识面试题-Hbase(2022版)https://blog.csdn.net/qq_43061290/article/details/125145399
8大数据知识面试题-sqoop(2022版)https://blog.csdn.net/qq_43061290/article/details/125145736
9大数据知识面试题-Kafka(2022版)https://blog.csdn.net/qq_43061290/article/details/125145841
10大数据知识面试题-Azkaban(2022版)https://blog.csdn.net/qq_43061290/article/details/125146859
11大数据知识面试题-Scala (2022版)https://blog.csdn.net/qq_43061290/article/details/125145976
12大数据知识面试题-Spark (2022版)https://blog.csdn.net/qq_43061290/article/details/125146030
13大数据知识面试题-Flink(2022版)https://blog.csdn.net/qq_43061290/article/details/125182137

1、sqoop

1.1、sqoop介绍

在这里插入图片描述

在这里插入图片描述

sqoop是apache旗下一款**“Hadoop和关系数据库服务器之间传送数据”**的工具。

导入数据:MySQL,Oracle导入数据到Hadoop的HDFS、HIVE、HBASE等数据存储系统;

**导出数据:**从Hadoop的文件系统中导出数据到关系数据库mysql等

将导入或导出命令翻译成mapreduce程序来实现

在翻译出的mapreduce中主要是对inputformat和outputformat进行定制

1.2、sqoop常见问题
1.2.1、sqoop中文数据乱码问题
  • mysql导入到hdfs
bin/sqoop import \
--connect jdbc:mysql://node03:3306/A  \
--username root \
--password 123456 \
--target-dir /A2 \
--table B --m 1

  • mysql导入到hive
bin/sqoop import \
--connect "jdbc:mysql://node03:3306/A?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table B \
--hive-import \
--m 1 \
--hive-database default;

  • 从hdfs导出到mysql
bin/sqoop export \
--connect "jdbc:mysql://node03:3306/A?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password 123456 \
--table B \
--export-dir /user/hive/warehouse/b

1.2.2、sqoop中文注释乱码问题

参考资料:https://www.cnblogs.com/qingyunzong/p/8724155.html

1.2.3、datax常见问题
  1. oom

    在datax 中导数据使用过程中往往会因为,目标数据过大导致datax oom,那么可以调大datax的jvm参数来防止oom,在python命令后,使用 -jvm=”-Xms5G -Xmx 5G”来调大
    
    python datax.py  --jvm="-Xms5G -Xmx5G" ../job/test.json
    
  2. 字段长度过长

    如果报java.io.IOException: Maximum column length of 100,000 exceeded in column...异常信息,说明数据源column字段长度超过了100000字符。
    需要在json的reader里增加如下配置
     "csvReaderConfig":{
     "safetySwitch": false,
      "skipEmptyRecords": false,
      "useTextQualifier": false
         }
       safetySwitch = false;//单列长度不限制100000字符
    
  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拉格朗日(Lagrange)

手敲不易,谢谢各位老板,打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值