<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: ToDate java.lang.illegalargumentexception invalid format is malformed in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102995#M15324</link>
    <description>&lt;P&gt;How to insert data into hive table in a particular date format (DD/MM/YY) from the below hive table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1904287&lt;/TD&gt;&lt;TD&gt;Christopher Rodriguez&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Jan 11, 2003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;96391595&lt;/TD&gt;&lt;TD&gt;Thomas Stewart&lt;/TD&gt;&lt;TD&gt;6/17/1969&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2236067&lt;/TD&gt;&lt;TD&gt;John Nelson&lt;/TD&gt;&lt;TD&gt;08/22/54&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Sun, 24 Jul 2016 02:20:45 GMT</pubDate>
    <dc:creator>niraj_tandel89</dc:creator>
    <dc:date>2016-07-24T02:20:45Z</dc:date>
    <item>
      <title>ToDate java.lang.illegalargumentexception invalid format is malformed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102992#M15321</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I just started
working with Hadoop a few weeks ago and already accoutered an issue with the date
format that I am not able to solve even so it is probably quite simple.&lt;/P&gt;&lt;P&gt;The input looks as
follows:&lt;/P&gt;&lt;PRE&gt;102,2009-10-08
12:00:00,3,3000100,2009-10-08 15:11:00,3,1500101,2009-11-20 23:59:00,2,1560103,2008-05-20 01:00:00,4,2060&lt;/PRE&gt;&lt;P&gt;The code I am
using:&lt;/P&gt;&lt;PRE&gt;a = LOAD
'/user/xyz/Orders2.txt' USING PigStorage(',') as (id:int,
date:chararray,kid:int,volume:double);b =
Foreach a Generate ToDate(date, 'yyyy/MM/dd HH:mm:ss') as dateString;DUMP b;&lt;/PRE&gt;&lt;P&gt;After the execution
I am retrieving the following message:&lt;/P&gt;&lt;PRE&gt;2016-01-18
11:14:07,743 [main] INFO
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher
- Failed!
2016-01-18 11:14:07,766 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
1066: Unable to open iterator for alias e. Backend error :
org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while
executing [POUserFunc (Name:
POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime] - scope-4 Operator Key:
scope-4) children: null at []]: java.lang.IllegalArgumentException: Invalid
format: "2009-10-08 12:00:00" is malformed at "-10-08
12:00:00"&lt;/PRE&gt;&lt;P&gt;Do I have to use a
UDF to fix the issue or can it be solved using simple pig commands?&lt;/P&gt;&lt;P&gt;I am grateful for
any advice.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 18:31:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102992#M15321</guid>
      <dc:creator>l_kinder</dc:creator>
      <dc:date>2016-01-18T18:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: ToDate java.lang.illegalargumentexception invalid format is malformed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102993#M15322</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2146/lkinder.html" nodeid="2146"&gt;@Lars Kinder&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the data format. I was able to reproduce it&lt;/P&gt;&lt;PRE&gt;2016-01-18 12:20:55,528 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Failed!2016-01-18 12:20:55,537 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1066: Unable to open iterator for alias b. Backend error : org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POUserFunc (Name: POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime] - scope-4 Operator Key: scope-4) children: null at []]: java.lang.IllegalArgumentException: Invalid format: "2009-10-08 12:00:00" is malformed at "-10-08 12:00:00"&lt;/PRE&gt;&lt;P&gt;Details at logfile: /home/hdfs/pig_1453119614848.log&lt;/P&gt;&lt;P&gt;grunt&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It worked with this &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;b = Foreach a Generate ToDate(date, 'yyyy-MM-dd HH:mm:ss') as dateString;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;2016-01-18 12:25:57,495 [main] INFO  org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl - Timeline service address: &lt;A href="http://sandbox.hortonworks.com:8188/ws/v1/timeline/" target="_blank"&gt;http://sandbox.hortonworks.com:8188/ws/v1/timeline/&lt;/A&gt;
2016-01-18 12:25:57,496 [main] INFO  org.apache.hadoop.yarn.client.RMProxy - Connecting to ResourceManager at sandbox.hortonworks.com/10.0.2.15:8050
2016-01-18 12:25:57,500 [main] INFO  org.apache.hadoop.mapred.ClientServiceDelegate - Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server
2016-01-18 12:25:57,604 [main] INFO  org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl - Timeline service address: &lt;A href="http://sandbox.hortonworks.com:8188/ws/v1/timeline/" target="_blank"&gt;http://sandbox.hortonworks.com:8188/ws/v1/timeline/&lt;/A&gt;
2016-01-18 12:25:57,604 [main] INFO  org.apache.hadoop.yarn.client.RMProxy - Connecting to ResourceManager at sandbox.hortonworks.com/10.0.2.15:8050
2016-01-18 12:25:57,609 [main] INFO  org.apache.hadoop.mapred.ClientServiceDelegate - Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server
2016-01-18 12:25:57,647 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Success!
2016-01-18 12:25:57,650 [main] INFO  org.apache.pig.data.SchemaTupleBackend - Key [pig.schematuple] was not set... will not generate code.
2016-01-18 12:25:57,663 [main] INFO  org.apache.hadoop.mapreduce.lib.input.FileInputFormat - Total input paths to process : 1
2016-01-18 12:25:57,664 [main] INFO  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input paths to process : 1&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;(2009-10-08T12:00:00.000Z)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;grunt&amp;gt; b = Foreach a Generate ToDate(date, 'yyyy-MM-dd HH:mm:ss') as dateString; &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 20:26:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102993#M15322</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-01-18T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: ToDate java.lang.illegalargumentexception invalid format is malformed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102994#M15323</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Neeraj,&lt;/P&gt;&lt;P&gt;thank you for the quick reply and help. It worked and I was able to convert the format. &lt;/P&gt;&lt;P&gt;Big thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 21:22:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102994#M15323</guid>
      <dc:creator>l_kinder</dc:creator>
      <dc:date>2016-01-18T21:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: ToDate java.lang.illegalargumentexception invalid format is malformed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102995#M15324</link>
      <description>&lt;P&gt;How to insert data into hive table in a particular date format (DD/MM/YY) from the below hive table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1904287&lt;/TD&gt;&lt;TD&gt;Christopher Rodriguez&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Jan 11, 2003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;96391595&lt;/TD&gt;&lt;TD&gt;Thomas Stewart&lt;/TD&gt;&lt;TD&gt;6/17/1969&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2236067&lt;/TD&gt;&lt;TD&gt;John Nelson&lt;/TD&gt;&lt;TD&gt;08/22/54&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 24 Jul 2016 02:20:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ToDate-java-lang-illegalargumentexception-invalid-format-is/m-p/102995#M15324</guid>
      <dc:creator>niraj_tandel89</dc:creator>
      <dc:date>2016-07-24T02:20:45Z</dc:date>
    </item>
  </channel>
</rss>

