Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # user - ERROR 1071: Cannot convert a generic_writablecomparable to a String


Copy link to this message
-
ERROR 1071: Cannot convert a generic_writablecomparable to a String
Niels Basjes 2013-07-10, 19:37
Hi,

I'm writing a custom Loader for Pig and I'm stuck on the following problem.

When I use this loader from a pig script and I do a "DESCRIBE Clicks;" I get
*Clicks: {useragent: chararray,status: chararray}*

So apparently the data from my loader is seen correctly.

How ever when I then do:
DUMP Clicks;

I get

*java.lang.Exception:
org.apache.pig.backend.executionengine.ExecException: ERROR
1071: Cannot convert a generic_writablecomparable to a String*
*        at
org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:404)*
*Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR
1071: Cannot convert a generic_writablecomparable to a String*
*        at org.apache.pig.data.DataType.toString(DataType.java:1105)*

What am I doing wrong here?
My current Loader in summary looks like this:

*public class Loader extends LoadFunc {
*
*   public Loader(String... parameters) { ... }
*
*   public InputFormat<?, ?> getInputFormat() throws IOException { ... }*
*   public Tuple getNext() throws IOException { *
*       ...*
*       List<Text> values = new ArrayList<Text>();*
*       for (...) {*
*           Text value  = <get the value from somewhere>*
*           values.add((Text)value);
*
*       }*
*       tuple = tupleFactory.newTuple(values);
*
*       return tuple;
*
*   }*
*
*
*   public void prepareToRead(...) { ... }
*
*   public void setLocation(String location, Job job) { ... }
*
*}*
--
Best regards / Met vriendelijke groeten,

Niels Basjes