crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject git commit: CRUNCH-409: Scrunch/Avro compatibility improvements
Date Mon, 09 Jun 2014 06:00:36 GMT
Repository: crunch
Updated Branches:
  refs/heads/master b4486cc9c -> a8ce5385e


CRUNCH-409: Scrunch/Avro compatibility improvements


Project: http://git-wip-us.apache.org/repos/asf/crunch/repo
Commit: http://git-wip-us.apache.org/repos/asf/crunch/commit/a8ce5385
Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/a8ce5385
Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/a8ce5385

Branch: refs/heads/master
Commit: a8ce5385ee674b6b14cdf095628be494d8d52229
Parents: b4486cc
Author: Josh Wills <jwills@apache.org>
Authored: Mon Jun 2 12:52:55 2014 -0700
Committer: Josh Wills <jwills@apache.org>
Committed: Sun Jun 8 22:54:02 2014 -0700

----------------------------------------------------------------------
 .../crunch/scrunch/ScalaSafeReflectDatumReader.java | 16 +---------------
 .../crunch/scrunch/ScalaSafeReflectDatumWriter.java |  2 +-
 2 files changed, 2 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/a8ce5385/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumReader.java
----------------------------------------------------------------------
diff --git a/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumReader.java
b/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumReader.java
index bbe7305..0db545e 100644
--- a/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumReader.java
+++ b/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumReader.java
@@ -41,21 +41,7 @@ public class ScalaSafeReflectDatumReader<T> extends ReflectDatumReader<T>
{
   @Override
   protected Object readArray(Object old, Schema expected,
       ResolvingDecoder in) throws IOException {
-    Schema expectedType = expected.getElementType();
-    long l = in.readArrayStart();
-    if (l > 0) {
-      Object array = newArray(old, (int) l, expected);
-      long base = 0;
-      do {
-        for (long i = 0; i < l; i++) {
-          addToArray(array, base + i, read(peekArray(array), expectedType, in));
-        }
-        base += l;
-      } while ((l = in.arrayNext()) > 0);
-      return scalaIterableCheck(array, expected);
-    } else {
-      return scalaIterableCheck(newArray(old, 0, expected), expected);
-    }
+    return scalaIterableCheck(super.readArray(old, expected, in), expected);
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/crunch/blob/a8ce5385/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumWriter.java
----------------------------------------------------------------------
diff --git a/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumWriter.java
b/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumWriter.java
index 1ac768c..3ecca70 100644
--- a/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumWriter.java
+++ b/crunch-scrunch/src/main/java/org/apache/crunch/scrunch/ScalaSafeReflectDatumWriter.java
@@ -46,7 +46,7 @@ public class ScalaSafeReflectDatumWriter<T> extends ReflectDatumWriter<T>
{
     if (array instanceof scala.collection.Iterable) {
       return JavaConversions.asJavaIterable((scala.collection.Iterable) array).iterator();

     }
-    return super.getArrayElements(array);
+    return (Iterator<Object>) super.getArrayElements(array);
   }
 
   @Override


Mime
View raw message