You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@crunch.apache.org by jw...@apache.org on 2012/08/22 08:26:48 UTC

[5/9] git commit: Always use the ReflectDatumReader for reflect Avro

Always use the ReflectDatumReader for reflect Avro

Use the ReflectDatumReader if reflect data is included in an
Avro PType, regardless of whether specific data is included

Signed-off-by: Josh Wills <jw...@cloudera.com>


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

Branch: refs/heads/master
Commit: dfe70ca96f120659b89f6ad961fcbf4340deb942
Parents: 89e58b3
Author: Gabriel Reid <ga...@gmail.com>
Authored: Tue Aug 21 20:38:19 2012 +0200
Committer: Josh Wills <jw...@cloudera.com>
Committed: Tue Aug 21 18:54:29 2012 -0700

----------------------------------------------------------------------
 .../crunch/types/avro/AvroGroupedTableType.java    |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/dfe70ca9/crunch/src/main/java/org/apache/crunch/types/avro/AvroGroupedTableType.java
----------------------------------------------------------------------
diff --git a/crunch/src/main/java/org/apache/crunch/types/avro/AvroGroupedTableType.java b/crunch/src/main/java/org/apache/crunch/types/avro/AvroGroupedTableType.java
index e15581d..ab68e71 100644
--- a/crunch/src/main/java/org/apache/crunch/types/avro/AvroGroupedTableType.java
+++ b/crunch/src/main/java/org/apache/crunch/types/avro/AvroGroupedTableType.java
@@ -85,9 +85,8 @@ public class AvroGroupedTableType<K, V> extends PGroupedTableType<K, V> {
     if (att.hasReflect()) {
       if (att.hasSpecific()) {
         Avros.checkCombiningSpecificAndReflectionSchemas();
-      } else {
-        conf.setBoolean(AvroJob.MAP_OUTPUT_IS_REFLECT, true);
       }
+      conf.setBoolean(AvroJob.MAP_OUTPUT_IS_REFLECT, true);
     }
     conf.set(AvroJob.MAP_OUTPUT_SCHEMA, schemaJson);
     job.setSortComparatorClass(AvroKeyComparator.class);
@@ -99,7 +98,8 @@ public class AvroGroupedTableType<K, V> extends PGroupedTableType<K, V> {
 
     Avros.configureReflectDataFactory(conf);
 
-    Collection<String> serializations = job.getConfiguration().getStringCollection("io.serializations");
+    Collection<String> serializations = job.getConfiguration().getStringCollection(
+        "io.serializations");
     if (!serializations.contains(SafeAvroSerialization.class.getName())) {
       serializations.add(SafeAvroSerialization.class.getName());
       job.getConfiguration().setStrings("io.serializations", serializations.toArray(new String[0]));