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 ?