Permalink
Browse files

Update to Avro 1.7.0 - resolves the ClassCastException issue: https:/…

  • Loading branch information...
1 parent 1d020be commit 76c5015687a2e97d55bd95e0715fe900adc78084 @tzolov tzolov committed Jun 28, 2012
Showing with 15 additions and 17 deletions.
  1. +1 −1 pom.xml
  2. +14 −16 src/test/java/com/cloudera/crunch/lib/SpecificAvroGroupByTest.java
View
@@ -9,7 +9,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <avro.version>1.6.3</avro.version>
+ <avro.version>1.7.0</avro.version>
<hadoop.version>0.20.2-cdh3u4</hadoop.version>
<hbase.version>0.90.6-cdh3u4</hbase.version>
</properties>
@@ -68,22 +68,20 @@ public void testGrouByWithSpecificAvroType() throws Exception {
testSpecificAvro(pipeline);
}
- @Test(expected = Exception.class)
- public void testGrouByOnSpecificAvroButReflectionDatumReader()
- throws Exception {
- MRPipeline pipeline = new MRPipeline(SpecificAvroGroupByTest.class);
-
- // Simulate the old (pre-fix) AvroSerializer implementation which
- // creates ReflectDatumReader even for specific Avro types. This leads
- // to:
- // java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to
- // java.util.List
- // at com.cloudera.crunch.test.Person.put(Person.java:49)
- pipeline.getConfiguration().setBoolean(AvroJob.MAP_OUTPUT_IS_REFLECT,
- true);
-
- testSpecificAvro(pipeline);
- }
+ @Test
+ public void testGrouByOnSpecificAvroButReflectionDatumReader()
+ throws Exception {
+ MRPipeline pipeline = new MRPipeline(SpecificAvroGroupByTest.class);
+
+ // https://issues.apache.org/jira/browse/AVRO-1046 resolves
+ // the ClassCastException when reading specific Avro types with
+ // ReflectDatumReader
+
+ pipeline.getConfiguration().setBoolean(AvroJob.MAP_OUTPUT_IS_REFLECT,
+ true);
+
+ testSpecificAvro(pipeline);
+ }
public void testSpecificAvro(MRPipeline pipeline) throws Exception {

0 comments on commit 76c5015

Please sign in to comment.