<?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: How to substractduration  of 1min from a ISO time in Pig ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110883#M16308</link>
    <description>&lt;PRE&gt;all the comments mentioned here are correct,this is small example


emp = load 'data' using PigStorage(',') as (empno,ename ,job,mgr,hiredate ,sal,comm,deptno);
each_date = foreach emp generate ToDate(hiredate,'dd-MMM-yyyy') as mydate;
subt = foreach each_date generate mydate,SubtractDuration(mydate,'PT1M');
dump subt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jan 2016 17:13:58 GMT</pubDate>
    <dc:creator>bsuresh</dc:creator>
    <dc:date>2016-01-27T17:13:58Z</dc:date>
    <item>
      <title>How to substractduration  of 1min from a ISO time in Pig ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110880#M16305</link>
      <description />
      <pubDate>Tue, 26 Jan 2016 06:33:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110880#M16305</guid>
      <dc:creator>psivala</dc:creator>
      <dc:date>2016-01-26T06:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to substractduration  of 1min from a ISO time in Pig ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110881#M16306</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/2247/psivala.html" nodeid="2247"&gt;@Pradeep Allu&lt;/A&gt;&lt;P&gt; See if this helps&lt;A target="_blank" href="https://pig.apache.org/docs/r0.11.1/api/org/apache/pig/builtin/SubtractDuration.html"&gt; https://pig.apache.org/docs/r0.11.1/api/org/apache/pig/builtin/SubtractDuration.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 06:41:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110881#M16306</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-01-26T06:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to substractduration  of 1min from a ISO time in Pig ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110882#M16307</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/2247/psivala.html" nodeid="2247"&gt;@Pradeep Allu&lt;/A&gt;&lt;P&gt;you need to refer to the standard for ISO 8601 to specify duration or period linked &lt;A href="https://en.m.wikipedia.org/wiki/ISO_8601#Durations"&gt;Here.&lt;/A&gt; For example PT1M is a one-minute duration. &lt;A href="https://github.com/apache/pig/blob/a44b85a0ab941cdd1d2d7f6e457303aef1e57501/src/org/apache/pig/builtin/SubtractDuration.java"&gt;Here's the implementation of the function&lt;/A&gt; if you need clear understanding. Get to know jodatime java library and Period object to get a handle on this function. Excellent question!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 07:58:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110882#M16307</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-01-26T07:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to substractduration  of 1min from a ISO time in Pig ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110883#M16308</link>
      <description>&lt;PRE&gt;all the comments mentioned here are correct,this is small example


emp = load 'data' using PigStorage(',') as (empno,ename ,job,mgr,hiredate ,sal,comm,deptno);
each_date = foreach emp generate ToDate(hiredate,'dd-MMM-yyyy') as mydate;
subt = foreach each_date generate mydate,SubtractDuration(mydate,'PT1M');
dump subt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:13:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110883#M16308</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2016-01-27T17:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to substractduration  of 1min from a ISO time in Pig ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110884#M16309</link>
      <description>&lt;P&gt;use ISO time pattern instead of dd-MMM-yyyy from my code&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:16:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-substractduration-of-1min-from-a-ISO-time-in-Pig/m-p/110884#M16309</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2016-01-27T17:16:04Z</dc:date>
    </item>
  </channel>
</rss>

