java.lang.String cannot be cast to java.lang.Integer

2014-05-30 Thread Patcharee Thongtra

Hi,

I got very strange exception.

80693 [main] ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1066: 
Unable to open iterator for alias ordered. Backend error : 
java.lang.String cannot be cast to java.lang.Integer
14/05/30 11:53:22 ERROR grunt.Grunt: ERROR 1066: Unable to open iterator 
for alias ordered. Backend error : java.lang.String cannot be cast to 
java.lang.Integer



In my pig script below, z is integer but pig complains as it is String.

query = load 'fino32' USING org.apache.hcatalog.pig.HCatLoader() as (
date: chararray,
u: float,
v: float,
t: float,
zone: int,
z: int);

ordered = ORDER query BY z;

dump ordered;


Any suggestion is appreciated.

Patcharee




Re: java.lang.String cannot be cast to java.lang.Integer

2014-05-30 Thread Piotr Dendek
Hi,

Handle null values,
check if the content of column z is definitely integer values,
ensure that no whitecharacters are included (e.g. 11 ).

Ultimately, you can read the z column as chararray and process it with udf.
This will give you chance to log the faulty record.

Tell if any of this removed the problem.

Piotr
30 maj 2014 12:02 Patcharee Thongtra patcharee.thong...@uni.no
napisał(a):

 Hi,

 I got very strange exception.

 80693 [main] ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1066: Unable
 to open iterator for alias ordered. Backend error : java.lang.String cannot
 be cast to java.lang.Integer
 14/05/30 11:53:22 ERROR grunt.Grunt: ERROR 1066: Unable to open iterator
 for alias ordered. Backend error : java.lang.String cannot be cast to
 java.lang.Integer


 In my pig script below, z is integer but pig complains as it is String.

 query = load 'fino32' USING org.apache.hcatalog.pig.HCatLoader() as (
 date: chararray,
 u: float,
 v: float,
 t: float,
 zone: int,
 z: int);

 ordered = ORDER query BY z;

 dump ordered;


 Any suggestion is appreciated.

 Patcharee





Re: java.lang.String cannot be cast to java.lang.Integer

2014-05-30 Thread Patcharee Thongtra

Hi,

column z is integer and not null, so I do not understand why I got cast 
exception.


Patcharee

On 05/30/2014 01:23 PM, Piotr Dendek wrote:

Hi,

Handle null values,
check if the content of column z is definitely integer values,
ensure that no whitecharacters are included (e.g. 11 ).

Ultimately, you can read the z column as chararray and process it with udf.
This will give you chance to log the faulty record.

Tell if any of this removed the problem.

Piotr
30 maj 2014 12:02 Patcharee Thongtra patcharee.thong...@uni.no
napisał(a):


Hi,

I got very strange exception.

80693 [main] ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1066: Unable
to open iterator for alias ordered. Backend error : java.lang.String cannot
be cast to java.lang.Integer
14/05/30 11:53:22 ERROR grunt.Grunt: ERROR 1066: Unable to open iterator
for alias ordered. Backend error : java.lang.String cannot be cast to
java.lang.Integer


In my pig script below, z is integer but pig complains as it is String.

query = load 'fino32' USING org.apache.hcatalog.pig.HCatLoader() as (
date: chararray,
u: float,
v: float,
t: float,
zone: int,
z: int);

ordered = ORDER query BY z;

dump ordered;


Any suggestion is appreciated.

Patcharee







Issue when building Pig

2014-05-30 Thread Botelho, Andrew
Hi all,

I am trying to build and install Pig 0.12.1.  I downloaded the tar file and 
unpackaged it.  Now I am trying to build Pig so that it can work with the 
version of Hadoop that I am using - version 2.4.0.  In order to do this, I 
enter the command:

ant clean jar-all -Dhadoopversion=23

However, during the build I get an error saying that it can't find the file 
jetty-6.1.26.zip.
Here is some of the stack trace:

[cid:image001.png@01CF7C01.5F877C80]

It seems like it is trying to download the file from a few sites, but the file 
can't be found at any of them.
Any suggestions or advice would be much appreciated.

Thanks,

Andrew Botelho
Intern
EMC Corporation
Education Services
Email: andrew.bote...@emc.commailto:andrew.bote...@emc.com


Re: Issue when building Pig

2014-05-30 Thread Cheolsoo Park
I've seen this before, and I believe it's some env issue because I can't
reproduce it on my laptop while my colleague can on his laptop.

If you look at ivy.xml, ivy shouldn't download  jetty-6.1.26.zip at all. I
couldn't figure out why this happens in certain environments.


On Fri, May 30, 2014 at 9:19 AM, Botelho, Andrew andrew.bote...@emc.com
wrote:

  Hi all,



 I am trying to build and install Pig 0.12.1.  I downloaded the tar file
 and unpackaged it.  Now I am trying to build Pig so that it can work with
 the version of Hadoop that I am using – version 2.4.0.  In order to do
 this, I enter the command:



 ant clean jar-all –Dhadoopversion=23



 However, during the build I get an error saying that it can’t find the
 file *jetty-6.1.26.zip*.

 Here is some of the stack trace:





 It seems like it is trying to download the file from a few sites, but the
 file can’t be found at any of them.

 Any suggestions or advice would be much appreciated.



 Thanks,



 Andrew Botelho

 Intern

 EMC Corporation

 Education Services

 Email: andrew.bote...@emc.com



Re:java.lang.String cannot be cast to java.lang.Integer

2014-05-30 Thread James
How about using the explicit cast like 


  ordered = ORDER query BY (int)z;

Alcaid

-- Original --
From:  Patcharee Thongtra;patcharee.thong...@uni.no;
Date:  Fri, May 30, 2014 06:02 PM
To:  useruser@pig.apache.org; 

Subject:  java.lang.String cannot be cast to java.lang.Integer



Hi,

I got very strange exception.

80693 [main] ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1066: 
Unable to open iterator for alias ordered. Backend error : 
java.lang.String cannot be cast to java.lang.Integer
14/05/30 11:53:22 ERROR grunt.Grunt: ERROR 1066: Unable to open iterator 
for alias ordered. Backend error : java.lang.String cannot be cast to 
java.lang.Integer


In my pig script below, z is integer but pig complains as it is String.

query = load 'fino32' USING org.apache.hcatalog.pig.HCatLoader() as (
date: chararray,
u: float,
v: float,
t: float,
zone: int,
z: int);

ordered = ORDER query BY z;

dump ordered;


Any suggestion is appreciated.

Patcharee