How to set "compressionType" property in Glue Table via CDK

0

I'm using a Table resource to create a Glue Table like so:

    this.glueTable = new Table(scope, `${props.glueTableName}`, {
      database: this.glueDatabase,
      tableName: props.glueTableName,
      bucket: props.bucket,
      partitionKeys: props.partitionKeys,
      dataFormat: props.dataFormat,
      columns: props.columns
    });

I need to explicitly set the compressionType of this table to "none". I see there is a way to do it via the console, where we go to Edit Table, and then fill in the compressionType under Table properties.

Can anyone point me to the prop to use if I want to do it using cdk?

asked 2 years ago1091 views
2 Answers
1

You'll need to use the CFN escape hatch:

const table = new Table(...);
const cfnTable = table.node.defaultChild as CfnTable;
cfnTable.addPropertyOverride('TableInput.Parameters.compressionType', 'none');
pmh
answered 2 years ago
0

Latest Glue module(v2.12.0) supports compressed option when creating table.

AWS
answered 2 years ago
  • Still not clear how to set something like this for example

    TBLPROPERTIES ( 'compression_level'='9', 'write.compression'='ZSTD' )

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions