Spark avro to parquet

Viewed 4603

I have a stream of avro formatted data (json encoded) which needs to be stored as parquet files. I could only do this,

val df = sqc.read.json(jsonRDD).toDF()

and write the df as parquet.

Here the schema is inferred form the json. But i already have the avsc file and I don't want spark to infer the schema from the json.

And in the above mentioned way the parquet files store the schema info as StructType and not as avro.record.type. Is there a way to store the avro schema information as well.

SPARK - 1.4.1

2 Answers
Related