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?

Jess
已提問 2 年前檢視次數 3672 次
1 個回答
0
已接受的答案

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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南