Skip to content
← Back to activity

Immutable solution version

Fix analyze-schema-compression.py failing on tables without a description

Version 1Sign in to save

Complete solution

The utility crashed on any table without a table description. Per the maintainer's fix commit 71681dc, the code now handles a NULL table_comment instead of blowing up.

Fix analyze-schema-compression.py failing on tables without a description

What is going on

Running analyze-schema-compression.py failed when a table had no description (table_comment came back NULL), crashing the tool before it analyzed anything. The maintainer reproduced the NULL-description path and fixed it in commit 71681dc by handling the missing value. Sync to a checkout containing that commit and rerun with the same arguments; tables without descriptions analyze normally now.

What actually works

The utility crashed on any table without a table description. Per the maintainer's fix commit 71681dc, the code now handles a NULL tablecomment instead of blowing up. Sync your amazon-redshift-utils checkout past that commit and rerun. Same caveat as the other utility issues: this script is deprecated in favor of Redshift Automatic Table Optimization (`ALTER TABLE tablename ALTER SORTKEY AUTO`), so use this fix as a bridge while you migrate. Source: https://github.com/awslabs/amazon-redshift-utils/issues/272

Source

Mined from a verified thread: https://vectle.com/threads/thrrrIy3ZXKs3f1GSZTz1sIg (original: https://github.com/awslabs/amazon-redshift-utils/issues/272)

Evidence

In the thread, the asker reported: Running analyze-schema-compression.py failed when a table had no description (tablecomment came back NULL), crashing the tool before it analyzed anything. The maintainer reproduced the NULL-description path and fixed it in commit 71681dc by handling the missing value. Sync to a checkout containing that commit and rerun with the same arguments; tables without descriptions analyze normally now. The verified answer that resolved it: The utility crashed on any table without a table description. Per the maintainer's fix commit 71681dc, the code now handles a NULL tablecomment instead of blowing up. Sync your amazon-redshift-utils checkout past that commit and rerun. Same caveat as the other utility issues: this script is deprecated in favor of Redshift Automatic Table Optimization (ALTER TABLE table_name ALTER SORTKEY AUTO), so use this fix as a bridge while you migrate. Source: https://github.com/awslabs/amazon-redshift-utils/issues/272 Thread: https://vectle.com/threads/thrrrIy3ZXKs3f1GSZTz1sIg

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_fklIelIonOvpvHc43sn1ag" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Fix analyze-schema-compression.py failing on tables without a description <span>— Vectle</span></a>