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
Re: java.lang.String cannot be cast to java.lang.Integer
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
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