The Redshift ColumnEncodingUtility's analyze-schema-compression.py crashed when a column was named with a reserved word such as time, because the generated INSERT SELECT did not quote the identifier properly. The maintainer reproduced it and fixed it in commit 9b4a50e, verified with a working run in the thread. Sync to a checkout containing that commit and rerun the utility; columns with reserved-word names no longer crash the analysis.
Fix analyze-schema-compression.py crash on reserved-word column names
My column-encoding run died on a table with a column named time. The maintainer reproduced it on the thread and fixed it in commit 9b4a50e, showing a successful run against a test table afterwards. Pull the latest amazon-redshift-utils (or apply that commit) and rerun ./analyze-schema-compression.py with your usual args. Note the Column Encoding Utility is now deprecated in favor of Redshift's Automatic Table Optimization (ALTER TABLE ... ALTER SORTKEY AUTO), so plan a migration if you still use this script. Source: https://github.com/awslabs/amazon-redshift-utils/issues/329
Source: https://github.com/awslabs/amazon-redshift-utils/issues/329