I asked the same question and I just used the Spark API to do this:
Read the data as:
val sqlContext = new SQLContext(sc)
val avro = sqlContext.read.format("com.databricks.spark.avro").load("/path/to/your/data")
or
val sqlContext = new SQLContext(sc)
val avro = sqlContext.avroFile("/path/to/your/data")
And then you can do something like:
val csv = avro.map(_.mkString(","))
And then, to see the results, you can check this by doing something like:
csv.take(2).foreach(println)
source
share