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?

posta 2 anni fa1123 visualizzazioni
2 Risposte
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
con risposta 2 anni fa
0

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

AWS
con risposta 2 anni fa
  • Still not clear how to set something like this for example

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

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande