<?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 Use of SIZE function in SUBSTRING  for PIG in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136474#M27592</link>
    <description>&lt;P&gt;I have a simple data covering the salary in USD like "$36200" as chararray. I am trying to remove the leading $ symbol through the SUBSTRING function as below:&lt;/P&gt;&lt;P&gt;D = FOREACH C GENERATE SUBSTRING(wage, 1, SIZE(wage)) as wage_new;&lt;/P&gt;&lt;P&gt;I am getting an error like this:&lt;/P&gt;&lt;P&gt;ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1045: 
Could not infer the matching function for org.apache.pig.builtin.SUBSTRING as multiple or none of them fit. Please use an explicit cast.&lt;/P&gt;&lt;P&gt;However, if I am using the StopIndex of the SUBSTRING function explicitly, then the code compiles. But I would like to get to the end of the string dynamically.&lt;/P&gt;&lt;P&gt;Can somebody help me ?&lt;/P&gt;</description>
    <pubDate>Sun, 08 May 2016 03:23:41 GMT</pubDate>
    <dc:creator>subhasis_roy</dc:creator>
    <dc:date>2016-05-08T03:23:41Z</dc:date>
    <item>
      <title>Use of SIZE function in SUBSTRING  for PIG</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136474#M27592</link>
      <description>&lt;P&gt;I have a simple data covering the salary in USD like "$36200" as chararray. I am trying to remove the leading $ symbol through the SUBSTRING function as below:&lt;/P&gt;&lt;P&gt;D = FOREACH C GENERATE SUBSTRING(wage, 1, SIZE(wage)) as wage_new;&lt;/P&gt;&lt;P&gt;I am getting an error like this:&lt;/P&gt;&lt;P&gt;ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1045: 
Could not infer the matching function for org.apache.pig.builtin.SUBSTRING as multiple or none of them fit. Please use an explicit cast.&lt;/P&gt;&lt;P&gt;However, if I am using the StopIndex of the SUBSTRING function explicitly, then the code compiles. But I would like to get to the end of the string dynamically.&lt;/P&gt;&lt;P&gt;Can somebody help me ?&lt;/P&gt;</description>
      <pubDate>Sun, 08 May 2016 03:23:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136474#M27592</guid>
      <dc:creator>subhasis_roy</dc:creator>
      <dc:date>2016-05-08T03:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use of SIZE function in SUBSTRING  for PIG</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136475#M27593</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3694/subhasisroy.html" nodeid="3694"&gt;@Subhasis Roy&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Substring wants Integer parameters while Size returns Long. Try casting the size to Int like this:&lt;/P&gt;&lt;PRE&gt;D = FOREACH C GENERATE SUBSTRING(wage, 1, (int)SIZE(wage)) as wage_new;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 May 2016 03:50:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136475#M27593</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-05-08T03:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Use of SIZE function in SUBSTRING  for PIG</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136476#M27594</link>
      <description>&lt;P&gt;Great !! Thanks a lot for the help. It works now.&lt;/P&gt;</description>
      <pubDate>Sun, 08 May 2016 14:38:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Use-of-SIZE-function-in-SUBSTRING-for-PIG/m-p/136476#M27594</guid>
      <dc:creator>subhasis_roy</dc:creator>
      <dc:date>2016-05-08T14:38:52Z</dc:date>
    </item>
  </channel>
</rss>

