glue treat empty string as null values

0

Hi Team,

I run an AWS glue job that reads data from a CSV file located on an S3 bucket to my aurora MySQL DB. My job fails because it interprets an empty string from the CSV ("") as a null value then try to insert it in a non-nullable column. is there a specific configuration in glue / pyspark code to prevent the job to treat an empty string as null?

1 Answer
0
Accepted Answer

I added this workaround on my pySpark script and that solve the issue :

data_frame = data_frame.na.fill('', subset=['MY_EMPTY_STRING_COL'])

Jess
answered 2 years 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