We have a MapR Cluster, on which this was running but now suddenly its stopped and even does not work on mapr demo cluster. We are running MapR 5.1 and Spark 1.6.1.
from pyspark import SparkConf, SparkContext
from pyspark import HiveContext
from pyspark.sql import DataFrameWriter
conf = SparkConf().setAppName('test')
sc = SparkContext(conf=conf)
sqlContext = HiveContext(sc)
df = sqlContext.createDataFrame([(2012, 8, "Batman", 9.8), (2012, 8, "Hero", 8.7), (2012, 7, "Robot", 5.5), (2011, 7, "Git", 2.0)],["year", "month", "title", "rating"])
df.show()
df.write.mode("append").format("com.databricks.spark.avro").save("/user/bedrock/output_avro")
sc.stop()
But now i am getting this error:
java.lang.IllegalAccessError: tried to access class org.apache.avro.SchemaBuilder$FieldDefault from class com.databricks.spark.avro.SchemaConverters$$anonfun$convertStructToAvro$1
Any ideas? This is as per the instructions on databricks github. I am invoking the pyspark shell or spark-submit using these packages:
/opt/mapr/spark/spark-1.6.1/bin/pyspark --packages com.databricks:spark-avro_2.10:2.0.1 --driver-class-path /opt/mapr/spark/spark-1.6.1/lib/avro-1.7.7.jar --conf spark.executor.extraClassPath=/opt/mapr/spark/spark-1.6.1/lib/avro-1.7.7.jar --master yarn-client