AWS Glue error to write redshift > 50000 records

0

Trying to write the records from S3 text file to Redshit. It running when the record count is around 10000, but running long and further connection timing out when trying to write the entire file (50K records)

df.write.format("jdbc").
option("url", redshiftclusterurl).
option("dbtable", dbtable).
option("user", username).
option("password", password).
option("connectTimeout", "120000").
mode('append').save()

AWS
asked 8 months ago182 views
1 Answer
0

It might be you have too many partitions and thus trying to use too many connections which Redshift might not accept.
You can you the option numPartitions to control this parallelism (or just repartition the data).

Please note using JDBC on Redshift as the data grows is inefficient, the Glue connector will scale much better (you can convert your DataFrame to DynamicFrame): https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-connect-redshift-home.html#aws-glue-programming-etl-connect-redshift-write

profile pictureAWS
EXPERT
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions