不可稀疏的日期错误 - Talend [英] Unparseable Date error - Talend

查看:177
本文介绍了不可稀疏的日期错误 - Talend的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据从Excel复制到SQL表。



我有使用RAND函数在Excel文件中生成的日期。我将它们作为输入中的字符串,并尝试使用tConvertType在日期数据类型中转换它们。



我已经将其数据类型设置为初始输入中的string tConvertType的输出和tMSSqlOutput中的'date'。



我的工作有工作流Excel输入 - > tConvertType - > tMap - > tMSSqlOutput。
在运行该作业时,我收到一个错误:
java.text.ParseException:Unparseable date:Tue Jul 17 00:00:00 EDT 1973



我不知道问题在哪里。
如果有人可以帮助我,这将是非常感谢。



这是我的工作的屏幕截图。

解决方案

我可以解析您给定的样本日期,请在tMap中使用以下函数提交日期。



System.out.println(TalendDate.parseDateLocale(EEE MMM dd HH:mm:ss zzz yyyy,'Tue Jul 17 00: 00:00 EDT 1973',EN));



function is yourDateColumn!= null&& ; !。equalsIgnoreCase(yourDateColumn)? TalendDate.parseDateLocale(EEE MMM dd HH:mm:ss zzz yyyy,yourDateColumn,EN):null


I am trying to copy data from Excel to a SQL table.

I have dates generated in Excel file using RAND function. I am taking them as strings in an input and trying to convert them in date data type using tConvertType.

I have setted its datatype as 'string' in initial input and as 'date' in tConvertType's output and in tMSSqlOutput.

My job has work flow Excel input -> tConvertType -> tMap -> tMSSqlOutput. While running the job I am getting an error which says : java.text.ParseException: Unparseable date: "Tue Jul 17 00:00:00 EDT 1973"

I am not sure where the problem lies. If anyone could help me with this it would be much appreciated.

Here's the screenshot of my job.

解决方案

i am able to parse your given sample date please use below function in tMap for your date filed.

System.out.println(TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss zzz yyyy", 'Tue Jul 17 00:00:00 EDT 1973', "EN"));

function is yourDateColumn!=null && !"".equalsIgnoreCase(yourDateColumn)? TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss zzz yyyy", yourDateColumn, "EN") :null

这篇关于不可稀疏的日期错误 - Talend的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆