<?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: defining datatype in Pig in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/defining-datatype-in-Pig/m-p/137780#M56180</link>
    <description>&lt;P&gt;col1 is already int based on your schema in load statement. You can check with&lt;/P&gt;&lt;PRE&gt;describe data;&lt;/PRE&gt;&lt;P&gt;If you want to change type with generate, you can do so like this&lt;/P&gt;&lt;PRE&gt;X = FOREACH A GENERATE c1 AS x1:int;&lt;/PRE&gt;</description>
    <pubDate>Sat, 04 Mar 2017 22:09:29 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2017-03-04T22:09:29Z</dc:date>
    <item>
      <title>defining datatype in Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/defining-datatype-in-Pig/m-p/137779#M56179</link>
      <description>&lt;P&gt;Im new to pig script to pardon me if my question is lame. I know that we can define a datatype for each atom in pig while loading it from a file. But is there a way we can define the datatype after taking a subset of it?&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;data = load 'mydata.csv' using PigStrogae(',') AS (col1:int, col2:int);&lt;/P&gt;&lt;P&gt;subsetdata = foreach data generate col1; --&amp;gt; Here i need to define the col1 as int . Is there a way to feed it?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 21:38:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/defining-datatype-in-Pig/m-p/137779#M56179</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-03-04T21:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: defining datatype in Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/defining-datatype-in-Pig/m-p/137780#M56180</link>
      <description>&lt;P&gt;col1 is already int based on your schema in load statement. You can check with&lt;/P&gt;&lt;PRE&gt;describe data;&lt;/PRE&gt;&lt;P&gt;If you want to change type with generate, you can do so like this&lt;/P&gt;&lt;PRE&gt;X = FOREACH A GENERATE c1 AS x1:int;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Mar 2017 22:09:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/defining-datatype-in-Pig/m-p/137780#M56180</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2017-03-04T22:09:29Z</dc:date>
    </item>
  </channel>
</rss>

