解决sqoop 导入oracle表时 --split-by参数为日期类型时的报错:ORA-01861: literal does not match format string
报错栈:
-- ::, INFO [main] org.apache.sqoop.mapreduce.db.DBRecordReader: Executing query: select "JFRQ","ZYH","FYKS","KSSE","YBJE","YPJE","ZJJE" from BSHIS."DEPCS_T_DEPCS_BRMXCOST_DAY" tbl where ( JFRQ >= '2009-01-01 00:00:00.0' ) AND ( JFRQ < '2009-10-13 04:00:00.0' )
-- ::, ERROR [main] org.apache.sqoop.mapreduce.db.DBRecordReader: Top level exception:
java.sql.SQLDataException: ORA-: literal does not match format string
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:)
at org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:)
at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:)
at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:)
at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:)
at org.apache.hadoop.mapred.YarnChild$.run(YarnChild.java:)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:)
-- ::, INFO [Thread-] org.apache.sqoop.mapreduce.AutoProgressMapper: Auto-progress thread is finished. keepGoing=false
-- ::, WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : java.io.IOException: SQLException in nextKeyValue
at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:)
at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:)
at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:)
at org.apache.hadoop.mapred.YarnChild$.run(YarnChild.java:)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:)
Caused by: java.sql.SQLDataException: ORA-: literal does not match format string
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:)
at org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:)
at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:)
... more
报错为sql抛出,sql改写后执行成功,下面两句都可以:
sqoop的一个bug: https://issues.apache.org/jira/browse/SQOOP-1946, 解决方案大致为转换成string类型即可。发现这个列的类型为date, 因此解决方案为: --split-by "to_char(我的日期列,'yyyy-mm-dd hh24:mi:ss')"。
参考:https://my.oschina.net/pomo/blog/725060
解决sqoop 导入oracle表时 --split-by参数为日期类型时的报错:ORA-01861: literal does not match format string的更多相关文章
- 解决:Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
今天在写存储过程的时候,老是报一个错.如下,记录下来,以供日后查阅. 报错: Oracle 异常 ORA-01861: literal does not match format string(字符 ...
- Oracle问题之literal does not match format string
问题: oerr ora 186101861, 00000, "literal does not match format string"// *Cause: Literals i ...
- Linux下编译程序时,经常会遇到“undefined reference to XXX” 报错,
Linux下编译程序时,经常会遇到“undefined reference to XXX” 报错, 这里总结一些可能的原因和解决方案,给需要的朋友: 说道undefined reference err ...
- 使用wkwebview时,push后,再pop返回,报错
使用wkwebview时,push后,再pop返回,报错 Cannot form weak reference to instance (xxxx) of class xxxx. It is poss ...
- 解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation
报错信息: -- ::, INFO [main] org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.a ...
- 解决Requests中文乱码【有用】,读取htm文件 读取txt文件报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0
打开这个网址https://blog.csdn.net/chaowanghn/article/details/54889835 python在open读取txt文件时,出现UnicodeDecodeE ...
- tomcat 1)启动时不识别执行启动命令 2)启动报错 3)关闭不了,用myEclipse启动时显示jvm_bind,端口占用
- py+selenium 直接给日期赋值,控制台调试报错【已解决】
目标:给带日期控件的输入框赋值. 百度去搜索让你各种去只读readonly属性,再send_keys 方法: 其实既然可以去除readonly属性,那就可以直接给属性赋值,将两行代码缩为一行. dri ...
- 解决incorrect 'only available in ES6' warning (W119) with options `moz: true, esversion: 6` 报错问题
很多同学在新建vue项目时,会遇到 incorrect 'only available in ES6' warning (W119) with options `moz: true, esversio ...
随机推荐
- Hive(一)Hive初识
一 Hive 简介 什么是Hive 1.Hive 由 Facebook 实现并开源 2.是基于 Hadoop 的一个数据仓库工具 3.可以将结构化的数据映射为一张数据库表 4.并提供 HQL(Hive ...
- 初识angularJS的基本概念
今天在这里分享分享我个人学习angular的知识点总结.在还没有接触到angular的时候,还真的不知道它到底有什么作用,直到我开始学习它,并且运用到它的时候,才知道angular这么强大.作为一个前 ...
- 【LOJ】#2041. 「SHOI2015」聚变反应炉
题解 这显然是一道题拆成两道 然后我胡乱分析了一波,决定第一题就用点度贪心(反正散播的能量肯定能被使用),然后过了 第二题开始mengbier 设\(f_u\)表示第u个点在父亲发动之后才发动的最小价 ...
- 【51nod】1531 树上的博弈
题解 我们发现每次决策的时候,我们可以判断某个点的决策,至少小于等于几个点或者至少大于等于几个点 我们求最大值 dp[u][1 / 0] dp[u][1]表示u这个点先手,至少大于等于几个点 dp[u ...
- 记录移动端html界面中底部输入框触发焦点时键盘会把输入框遮挡的问题
//浏览器当前的高度 var oHeight = $(document).height(); //监听窗口大小的时候动态改变底部输入框控制器的定位 $(window).resize(functio ...
- redhat重置密码
当忘记虚拟机密码时怎么办? 1.启动虚拟机,当虚拟机显示输入enter启动时输入e 2.再次用上下键选中你平时启动linux的那一项(类似于kernel /boot/vmlinuz-2.4.18-14 ...
- hdoj1171 Big Event in HDU(01背包 || 多重背包)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1171 题意 老师有一个属性:价值(value).在学院里的老师共有n种价值,每一种价值value对应着 ...
- Spring Boot使用Log4j Implemented Over SLF4J生成日志并在控制台打印
Spring Boot设置切面,执行方法的时候在控制台打印出来,并生成日志文件 引入依赖: <!--日志--> <dependency> <groupId>org. ...
- 安装部署VMware vSphere 5.5文档 (6-4) 安装配置DB数据库
部署VMware vSphere 5.5 实施文档 ########################################################################## ...
- [ 转载 ]学习笔记-深入剖析Java中的装箱和拆箱
深入剖析Java中的装箱和拆箱 自动装箱和拆箱问题是Java中一个老生常谈的问题了,今天我们就来一些看一下装箱和拆箱中的若干问题.本文先讲述装箱和拆箱最基本的东西,再来看一下面试笔试中经常遇到的与装箱 ...