java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter
See original GitHub issueHi1
I am using spark-redshift to save dataframe into redshift but facing following exception.
java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema;)Lorg/apache/avro/io/DatumWriter;
at org.apache.avro.mapreduce.AvroKeyRecordWriter.<init>(AvroKeyRecordWriter.java:55)
at org.apache.avro.mapreduce.AvroKeyOutputFormat$RecordWriterFactory.create(AvroKeyOutputFormat.java:79)
at org.apache.avro.mapreduce.AvroKeyOutputFormat.getRecordWriter(AvroKeyOutputFormat.java:105)
at com.databricks.spark.avro.AvroOutputWriter.<init>(AvroOutputWriter.scala:82)
at com.databricks.spark.avro.AvroOutputWriterFactory.newInstance(AvroOutputWriterFactory.scala:31)
at org.apache.spark.sql.execution.datasources.DefaultWriterContainer.writeRows(WriterContainer.scala:234)
at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation$$anonfun$run$1$$anonfun$apply$mcV$sp$3.apply(InsertIntoHadoopFsRelation.scala:150)
at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation$$anonfun$run$1$$anonfun$apply$mcV$sp$3.apply(InsertIntoHadoopFsRelation.scala:150)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
at org.apache.spark.scheduler.Task.run(Task.scala:88)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
[SOLVED] java.lang.NoSuchMethodError: org.apache.avro ...
[SOLVED] java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter When Using Avro Data with MapReduce.
Read more >apache - Exception in deserializing avro object in map reduce
Exception: java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema;)Lorg/apache/avro/io/ ...
Read more >java.lang.NoSuchMethodError: org.apache.avro.Schema ...
Hi I am upgrading an existing application using a kafka-client + Avro schemas to the following versions: <avro.version>1.11.0</avro.version> ...
Read more >Solved: Sqoop import of Avro file from Teradata to hdfs.
YarnChild: Error running child : java.lang.NoSuchMethodError: org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema ...
Read more >'Re: avro run error' - MARC
YarnChild: > Error running child : java.lang.NoSuchMethodError: > org.apache.avro.generic.GenericData.createDatumWriter(Lorg/apache/avro/Schema ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i am using spark-avro latest version but i am facing same issue. Spark-redshift is really pissing me off 😦
There are multiple options to do so.
you can use same approach as Spark-RedShift and save your data from in S3 bucket and then run copy command using redshift jdbc driver.
Use SaveAsHadoopDataSet as in following code
database + “?user=” + username + “&password=” + password val records = df.map(row => (TableRow(row.toString, columnTypes), null)) val jobConf = new JobConf() DBConfiguration.configureDB(jobConf, “org.postgresql.Driver”, dbUrl, username, password) DBOutputFormat.setOutput(jobConf, table, columns: _*) records.saveAsHadoopDataset(jobConf)
On Mon, May 23, 2016 at 12:46 AM, WillSidebottom notifications@github.com wrote:
Regards: HAFIZ MUJADID