Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain 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
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
+
Niels Basjes 2013-07-10, 19:51
+
Pradeep Gollakota 2013-07-10, 20:01
+
Niels Basjes 2013-07-10, 21:12
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB