Comments (9)
i am using spark-avro latest version but i am facing same issue. Spark-redshift is really pissing me off :(
from spark-redshift.
I suspect that this is caused by an older version of Avro being used. Over at the spark-avro
repo, databricks/spark-avro#91 discusses how this problem can occur on EMR, where the older version of Avro that's provided by the EMR environment takes precedence. If you happen to be running on EMR, check out the bottom of that thread for a workaround / fix.
from spark-redshift.
If you read the spark-avro
issue that I linked upthread, you'll see that the problem is due to the versions of the avro-mapred
library that is provided by your runtime environment, which is independent of the spark-avro
version that you're using. In order to debug this issue, you'll need to figure out where avro-mapred
is coming from and see which version is being used.
If it was me, I'd use Class.forName
and the steps described in https://stackoverflow.com/questions/1983839/determine-which-jar-file-a-class-is-from to figure out which JARs org.apache.avro.mapreduce.AvroKeyRecordWriter
and org.apache.avro.generic.GenericData
are being loaded from; once you know where the dependencies are coming from, we should be able to figure out how to ensure that a newer version of Avro gets used.
from spark-redshift.
thanks Josh :) i will try your solution
On Tue, Dec 1, 2015 at 12:54 AM, Josh Rosen [email protected]
wrote:
If you read the spark-avro issue that I linked upthread, you'll see that
the problem is due to the versions of the avro-mapred library that is
provided by your runtime environment, which is independent of the
spark-avro version that you're using. In order to debug this issue,
you'll need to figure out where avro-mapred is coming from and see which
version is being used.If it was me, I'd use Class.forName and the steps described in
https://stackoverflow.com/questions/1983839/determine-which-jar-file-a-class-is-from
to figure out which JARs org.apache.avro.mapreduce.AvroKeyRecordWriter
and org.apache.avro.generic.GenericData are being loaded from; once you
know where the dependencies are coming from, we should be able to figure
out how to ensure that a newer version of Avro gets used.—
Reply to this email directly or view it on GitHub
#129 (comment)
.
Regards: HAFIZ MUJADID
from spark-redshift.
I'm going to close this issue as 'not a spark-redshift
issue', since I don't think that there's anything actionable here from our side. Feel free to update this thread if you'd still like some help in debugging your environment issue.
from spark-redshift.
@hafizmujadid Did you ever get this issue fixed? I'm running into the same problem, just trying to save a simple DataFrame into aws Redshift.
-Thanks!
from spark-redshift.
No, I could not get this issue fixed and left the effort to use spark_redshift
from spark-redshift.
OK, are you still writing data to Redshift from spark? If so, how are you doing it?
Thanks again!
from spark-redshift.
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
val dbUrl = "jdbc:postgresql://" + endpoint + ":" + port + "/" +
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 [email protected]
wrote:
OK, are you still writing data to Redshift from spark? If so, how are you
doing it?
Thanks again!—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#129 (comment)
Regards: HAFIZ MUJADID
from spark-redshift.
Related Issues (20)
- spark-redshift generate corrupted Parquet files
- Caused by: org.jets3t.service.impl.rest.HttpException: 400 Bad Request--> py4j.protocol.Py4JJavaError: An error occurred while calling o42.save. : org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
- Any plan to support Scala 2.12? HOT 2
- tempdir is not being cleaned up after successful load to redshift HOT 1
- Spark SQL module compatability
- loading credentials from AWS_WEB_IDENTITY_TOKEN_FILE
- How are temporary files created in S3 when calling the driver? HOT 1
- Support unload to tempdir with specified KMS key
- Error when saving a dataframe to Redshift (java.lang.ArrayStoreException: java.lang.invoke.SerializedLambda) HOT 1
- [Question] Don't know how to save StructField
- Getting SignatureDoesNotMatch Error
- error while writing to Redshift: Cannot merge com.databricks.spark.redshift.HashSetAccumulator
- Pushdown filter not working with Varchar datatype HOT 1
- Is it possible to add columns to redshift table automatically? #1256
- Redshift support binary type since december 2021 HOT 1
- Databricks read from redshift first selected column returns wrong value if quotes used
- Java.lang.IllegalArgumentException: Wrong FS s3://bucket/folder/manifest.json -expected s3a://bucket HOT 1
- Spark 3.3 support HOT 1
- py4j.protocol.Py4JJavaError: An error occurred while calling o96.save.
- java.sql.SQLException: [Amazon][JDBC](11380) Null pointer exception.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-redshift.