found a different way to create avro record writers for both cdh4 and cdh5