cloudera/crunch — pull request #19 by tzolov (2012-05-04 00:22:35+00:00)
Title: Fix a bug causing ClassCastException when grouping Specific Avro types

The SafeAvroSerialization creates ReflectDatumReader for Specific Avro types as well. This leads to array cast exceptions when specific avro values are being grouped (e.g groupBy() ).

The SpecificAvroGroupByTest illustrates the issue.

To resolve it I have modified the SafeAvroSerializer#getDeserializer to take into account the AvroJob.MAP_OUTPUT_IS_REFLECT configuration when selecting the DatumReader. It takes SpecificDatumReader when the MAP_OUTPUT_IS_REFLECT is not set and falls back to the exiting behavior otherwise.
I have changed also the AvroGroupedTableType#configureShuffle implementation to set the MAP_OUTPUT_IS_REFLECT property only if both the Key and the Value types are NOT Specific.