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 Antwort
0
Akzeptierte Antwort

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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen