How to import com.databricks.avro._


#1

am getting “No module named com.databricks.spark.avro._” error

I’ve tried
pyspark --master yarn --conf spark.ui.port=12567 --packages com.databricks:spark-avro_2.10:2.0.1
pyspark --master yarn --conf spark.ui.port=12567 --packages com.databricks:spark-avro_2.11:4.0.0

command that are suggested in discussion,but progress is in vain


#2

Can you try now and let us know


#3

hi @Sunil_Itversity , even now i cant import the package


#4

@Hariharan_Palanicham You don’t need to do the import. Go ahead with the code directly once you have loaded pyspark with avro library.

Try the below code to read avro file in a data frame.

df = sqlContext.read.format(“com.databricks.spark.avro”).load(“file.avro”)
df.show()