title: Pig UDF not finding WritableComparable
body: <p>I am getting the following error when trying to compile my Pig UDF with maven (or with my IDE IntelliJ for that matter) :</p>
  
  <pre><code>cannot access org.apache.hadoop.io.WritableComparable
  class file for org.apache.hadoop.io.WritableComparable not found
  </code></pre>
  
  <p>So I figured I'd add a dependency to hadoop-core to my POM file but still no change, though I checked and the WritableComparable class is in the jar.</p>
  
  <p>My UDF class looks like this :</p>
  
  <pre><code>public class INCREMENTAL_UPDATE extends EvalFunc&lt;DataBag&gt; {
  
      TupleFactory tupleFactory = TupleFactory.getInstance();
      BagFactory bagFactory = BagFactory.getInstance();
  
  
      public DataBag exec(Tuple input) throws IOException {
          if (null == input || input.size() != 0) {
              return null;
          }
  
          try {
              DataBag inputbag = (DataBag) input.get(0);
              Iterator it = inputbag.iterator();
  
              DataBag outputbag = bagFactory.newDefaultBag();
  
              Tuple previousTuple = null;
              while (it.hasNext()) {
                  Tuple currentTuple = (Tuple) it.next();
                  Tuple outputTuple = tupleFactory.newTuple();
  
                  for (int i = 0; i &lt; currentTuple.size(); i++) {
                      Object currentvalue = currentTuple.get(i);
                      if (currentvalue == null) {
                          outputTuple.append(currentvalue);
                      } else {
                          outputTuple.append(previousTuple.get(i));
                      }
                  }
  
                  previousTuple = outputTuple;
                  outputbag.add(outputTuple);
             }
              return outputbag;
          } catch (Exception e) {
             throw new IOException("UDF INCREMENTAL_UPDATE failed");
          }
      }
  }
  </code></pre>
  
  <p>I am yet to figure out if this would actually work, since I'm unsure if a UDF is distributed. If it is, that previousTuple probably would not work. But I can't even test that out because I can't compile because of the error above.</p>