Permalink
Browse files

Update WritableLoadCaster to work with pig0.9

This is a minor fix. In pig0.9, they changed around the LoadCaster
interface. Since elephantbird implements this, it is causing errors to
be thrown in code that works in pig0.8. This is a minor fix that makes
these errors go away.
  • Loading branch information...
1 parent 31f2973 commit 5fa4d305d919b3f3db666277eca86f011975367a Jonathan Coveney committed Nov 3, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/java/com/twitter/elephantbird/pig/util/WritableLoadCaster.java
@@ -77,6 +77,10 @@ public Double bytesToDouble(byte[] bytes) throws IOException {
public Map<String, Object> bytesToMap(byte[] bytes) throws IOException {
return toMap(writable = readFields(bytes, writable));
}
+
+ public Map<String, Object> bytesToMap(byte[] bytes, ResourceFieldSchema schema) throws IOException {
+ return toMap(writable = readFields(bytes, writable), schema);
+ }
@Override
public Tuple bytesToTuple(byte[] bytes, ResourceFieldSchema schema) throws IOException {
@@ -111,6 +115,10 @@ protected Double toDouble(W writable) throws IOException {
protected Map<String, Object> toMap(W writable) throws IOException {
throw new UnsupportedOperationException();
}
+
+ protected Map<String, Object> toMap(W writable, ResourceFieldSchema schema) throws IOException {
+ throw new UnsupportedOperationException();
+ }
protected Tuple toTuple(W writable, ResourceFieldSchema schema) throws IOException {
throw new UnsupportedOperationException();

0 comments on commit 5fa4d30

Please sign in to comment.