<?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: PIG: Unable to open iterator for alias AliasName.Scalar has more than one row in the output in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-Unable-to-open-iterator-for-alias-AliasName-Scalar-has/m-p/136745#M39753</link>
    <description>&lt;P&gt;I think i found the answer on my own.&lt;/P&gt;&lt;PRE&gt;B = FOREACH words GENERATE CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime()));&lt;/PRE&gt;&lt;P&gt;I just removed &lt;STRONG&gt;A. from the inner CONCAT&lt;/STRONG&gt;. And it worked fine.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 20:07:37 GMT</pubDate>
    <dc:creator>mohan221213</dc:creator>
    <dc:date>2016-09-06T20:07:37Z</dc:date>
    <item>
      <title>PIG: Unable to open iterator for alias AliasName.Scalar has more than one row in the output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-Unable-to-open-iterator-for-alias-AliasName-Scalar-has/m-p/136744#M39752</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am new to pig and trying to learn on my own.&lt;/P&gt;&lt;P&gt;I have written a script to get the epoch time with a word that is reading from words.txt file.&lt;/P&gt;&lt;P&gt;Here is the script.&lt;/P&gt;&lt;PRE&gt;words = LOAD 'words.txt' AS word:chararray;&lt;/PRE&gt;
&lt;PRE&gt;B = FOREACH A GENERATE CONCAT(CONCAT(A.word,'_'),(chararray)ToUnixTime(CurrentTime());
&lt;/PRE&gt;
&lt;PRE&gt;dump B;&lt;/PRE&gt;&lt;P&gt;But the issue is, if words.txt file have only one word it is giving proper output.&lt;/P&gt;&lt;P&gt;If it is having multiple words like&lt;/P&gt;&lt;PRE&gt;word1
word2
word3
word4
&lt;/PRE&gt;&lt;P&gt;then it is giving the following error&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; ERROR 1066: Unable to open iterator for alias B
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;java.lang.Exception: org.apache.pig.backend.executionengine.ExecException: ERROR 0: &lt;STRONG&gt;Scalar has more than one row in the output. 1st : (word1 ), 2nd :(word2) (common cause: "JOIN" then "FOREACH ... GENERATE foo.bar" should be "foo::bar" )&lt;/STRONG&gt;
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 0: &lt;STRONG&gt;Scalar has more than one row in the output. 1st : (word1 ), 2nd :(word2) (common cause: "JOIN" then "FOREACH ... GENERATE foo.bar" should be "foo::bar" )&lt;/STRONG&gt;
at org.apache.pig.impl.builtin.ReadScalars.exec(ReadScalars.java:122)
at o&lt;/P&gt;&lt;P&gt;Please suggest me to solve this issue.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Mohan.V&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 13:40:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-Unable-to-open-iterator-for-alias-AliasName-Scalar-has/m-p/136744#M39752</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-06T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: PIG: Unable to open iterator for alias AliasName.Scalar has more than one row in the output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-Unable-to-open-iterator-for-alias-AliasName-Scalar-has/m-p/136745#M39753</link>
      <description>&lt;P&gt;I think i found the answer on my own.&lt;/P&gt;&lt;PRE&gt;B = FOREACH words GENERATE CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime()));&lt;/PRE&gt;&lt;P&gt;I just removed &lt;STRONG&gt;A. from the inner CONCAT&lt;/STRONG&gt;. And it worked fine.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:07:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-Unable-to-open-iterator-for-alias-AliasName-Scalar-has/m-p/136745#M39753</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-06T20:07:37Z</dc:date>
    </item>
  </channel>
</rss>

