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:02:52 GMT
Repository: crunch
Updated Branches:
  refs/heads/apache-crunch-0.8 a49db45bb -> 83b0dba7c


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/83b0dba7
Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/83b0dba7
Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/83b0dba7

Branch: refs/heads/apache-crunch-0.8
Commit: 83b0dba7c2e66fde8d1e093c492b41a3217f2ad4
Parents: a49db45
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 23:01:05 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/83b0dba7/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/83b0dba7/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