amazon-web-servicesamazon-redshiftaws-gluevarchar

Redshift STL_LOAD_ERRORS col_length (256) different than DDL (12000)


I have a table called 'sales' which has a column called 'reason'. I am trying to load data into the column.

The data is;

"They found an issue with the software causing one of the chips an issue leading to the oven not operating correctly to being with. They rewrote the software while on site, software downloaded into all controllers and checked. The oven was left working as per usual when the team left site
"

The column in the table is created as below;

reason, character varying(12000), null, ENCODE lzo

In stl_load_errors the error message is 'String length exceeds DDL length'

I have checked:

OCTET_LENGTH(reason) = 296

I am confused to why Redshift thinks the column length is 256 when it is actually 12000.

This happens on an Merge data in Glue. BUT when I truncate the table it processes fine.

Thanks, Chris


Solution

  • I got same bug and only could solve editing the script after finding this post. Hope it helps until AWS fix it.

    Glue job failed when trying to perform a merge into Redshift table due to string length limits for VARCHAR/TEXT characters