0
votes

This error is incurred by the following row in create table sentence.

movie_title VARCHAR encode text255,

the default VARCHAR length in Redshift is 256, and 256>255, so

Unable to execute this query or statement

ERROR: ----------------------------------------------- error: Maximum column length exceeds 255 code: 8001 context: Limit is due to use of text255 encoding query: 0 location: column.cpp:167 process: padbmaster [pid=9637] -----------------------------------------------

The error goes away if I change text255 to text32k,

But as far as I have understood, the text255 compression does not work in this way.

It use one byte (255) to dictionary encode the text in columns, any words that are not represented in the dictionary are stored uncompressed

reference: http://docs.aws.amazon.com/redshift/latest/dg/c_Text255_encoding.html

shouldn't cause this problem. How can I explain this error ?

1

1 Answers

0
votes

Looks like there is another limitation which each word size for compression must be less than 255 bytes. The column size to apply text255 might be restricted in connection with this.

Actually I can set text255 encoding to varchar(255), like movie_title VARCHAR(255) encode text255.