I have a strange issue with data types. We have a custom loader which
loads data from logs similar to apache logs.
It sets the type of a field(var) to be int. When I examine its type, it
shows it to be int(using describe). However, when I do a numeric
comparison (for example: var==200) it throws an error.
java.lang.ClassCastException: java.lang.Integer cannot be cast to
And when a string comparison is done (using var == '200'), it again
throws an error.
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1039: Incompatible types
in EqualTo Operator left hand side:int right hand side:chararray
When I explicitly type cast or use a UDF to convert it from string to
integer or long and then do the numeric comparison, it works fine.
I searched if there are any previously such issues have been reported
before, but I couldnt find anything related.
It would be great if any one could throw more light on this if I am
missing something here.