hive表导出到mysql报错
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
hadoop@hadoop-virtual-machine:~/app/sqoop-1.4.6-cdh5.7.0$ bin/sqoop export --connect jdbc:mysql://localhost:3306/dbtaobao --username root --password 110110110 --table user_log --export-dir '/user/hive/warehouse/dbtaobao.db/inner_user_log' --fields-terminated-by ',';
Warning: /home/hadoop/app/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /home/hadoop/app/sqoop-1.4.6-cdh5.7.0/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/hadoop/app/sqoop-1.4.6-cdh5.7.0/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/hadoop/app/sqoop-1.4.6-cdh5.7.0/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
18/09/13 07:35:48 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.7.0
18/09/13 07:35:48 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
18/09/13 07:35:48 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
18/09/13 07:35:48 INFO tool.CodeGenTool: Beginning code generation
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
18/09/13 07:35:49 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `user_log` AS t LIMIT 1
18/09/13 07:35:49 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `user_log` AS t LIMIT 1
18/09/13 07:35:49 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /home/hadoop/app/hadoop-2.6.0-cdh5.7.0
注: /tmp/sqoop-hadoop/compile/93c07aefc0d6cf53115cac026f3ec442/user_log.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
18/09/13 07:35:56 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/93c07aefc0d6cf53115cac026f3ec442/user_log.jar
18/09/13 07:35:56 INFO mapreduce.ExportJobBase: Beginning export of user_log
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:42)
at org.apache.sqoop.SqoopOptions.writeProperties(SqoopOptions.java:742)
at org.apache.sqoop.mapreduce.JobBase.putSqoopOptionsToConfiguration(JobBase.java:369)
at org.apache.sqoop.mapreduce.JobBase.createJob(JobBase.java:355)
at org.apache.sqoop.mapreduce.ExportJobBase.runExport(ExportJobBase.java:417)
at org.apache.sqoop.manager.SqlManager.exportTable(SqlManager.java:931)
at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:81)
at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:100)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 14 more
解决:
这是因为sqoop缺少java-json.jar包.
下载java-json.jar包:
http://www.java2s.com/Code/Jar/j/Downloadjavajsonjar.htm
把java-json.jar添加到../sqoop/lib目录
hive表导出到mysql报错的更多相关文章
- oracle 空表导出dmp会报错
步骤一.查找出来的语句全部复制并执行 select 'analyze table '||table_name||' compute statistics;' from user_tables; 步骤二 ...
- MySQL 表与字段编码格式报错
MySQL 表与字段编码格式报错 一.数据库,表,字段编码格式都为latin1(iso-8859-1) .当数据保存到数据库后,中文显示乱码. 解决办法: 1.在访问数据库连接串中添加编码格式: &l ...
- [Sqoop]将Hive数据表导出到Mysql
业务背景 mysql表YHD_CATEG_PRIOR的结构例如以下: -- Table "YHD_CATEG_PRIOR" DDL CREATE TABLE `YHD_CATEG_ ...
- mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it"
mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it" 现 ...
- mysql报错Ignoring the redo log due to missing MLOG_CHECKPOINT between
mysql报错Ignoring the redo log due to missing MLOG_CHECKPOINT between mysql版本:5.7.19 系统版本:centos7.3 由于 ...
- Mysql报错注入原理分析(count()、rand()、group by)
Mysql报错注入原理分析(count().rand().group by) 0x00 疑问 一直在用mysql数据库报错注入方法,但为何会报错? 百度谷歌知乎了一番,发现大家都是把官网的结论发一下截 ...
- 解决:MySQL 报错:1045 - Access denied for user 'root'@'localhost'(using password YES)
一.前言 今年疯狂迷上了开源,只要看到好的开源项目,就会不顾一切一股脑扎进去研究,五一期间发现一个很好的关于众筹的开源项目,但不巧,这个项目竟然是 PHP 写的,没学过 PHP,自然对这个开源项目毫无 ...
- mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage
mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage 在执行cr ...
- Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to connect
Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to co ...
随机推荐
- 学生信息管理系统--基于jsp技术和MySQL的简单增删改查
web实现增删改查的方式有很多啊,对于初学者来说当然是要先了解各部分的传值的方式.本篇博客从jsp技术的最基础方面进行说明. 一.什么是jsp技术 首先,我们要了解什么是jsp技术. jsp技术是基于 ...
- Real DOM和 Virtual DOM 的区别?优缺点?
一.是什么 Real DOM,真实DOM, 意思为文档对象模型,是一个结构化文本的抽象,在页面渲染出的每一个结点都是一个真实DOM结构,如下: Virtual Dom,本质上是以 JavaScript ...
- js表单插件
参考:https://www.html5tricks.com/category/jquery-plugin/jquery-form
- HCNA Routing&Switching之动态路由协议OSPF DR和BDR
前文我们了解了OSPF建立邻居关系的条件,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15032907.html:今天我们来聊一聊OSPF中的DR和BDR: ...
- shell脚本(10)-流程控制while
一.while循环介绍 while循环与for一样,一般不知道循环次数使用for,不知道循环的次数时推荐使用while 二.while语法 while [ condition ] #条件为真才会循环, ...
- Python基础之获取路径与切换路径
一直以为我写了关于路径有关的博客,看了一圈才发现没写,那么现在就来整理下. 一.获取当前路径 os.getcwd() 二.获取当前文件路径:(__file__是当前执行文件) os.path.absp ...
- nfs(2049)未授权访问
apt install nfs-common 安装nfs客户端 showmount -e 192.168.244.128 查看nfs服务器上的共享目录 /666/share ...
- Moonraker靶机
仅供个人娱乐 靶机搭建与下载 Monraker靶机ip: 192.168.181.135 kali攻击者ip : 192.168.181.128 说明:获取目标主机的root权限并读取目录中的flag ...
- 大数据学习(26)—— Spark之RDD
做大数据一定要有一个概念,需要处理的数据量非常大,少则几十T,多则上百P,全部放内存是不可能的,会OOM,必须要用迭代器一条一条处理. RDD叫做弹性分布式数据集,是早期Spark最核心的概念,是一种 ...
- 使用 GLFW 在 OpenGL 的场景中漫游
前言 前面已经建立了 OpenGL 框架,加载了 3D 模型,但是还没有在场景中漫游的功能.为了展示 3D 模型,我只是简单地利用变换视图矩阵的方式使模型在视野中旋转.同时,之前的程序连最简单的改变窗 ...