# StorageParameter

A storage parameter. The list of storage parameters available is not exhaustive and other keys may be used.

If you would like to specify a storage parameter that is not available as a static member of this class, use the `StorageParameter.custom` method.

The list of storage parameters currently known within the CDK is listed.

- Source: [`lib/storage-parameter.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-glue-alpha/lib/storage-parameter.ts#L305)
- Type last changed: v2.270.0-alpha.0 · 18 Sep 2026

## Example

```ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
  storageParameters: [
    glue.StorageParameter.skipHeaderLineCount(1),
    glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
    glue.StorageParameter.custom('separatorChar', ',')
  ],
  // ...
  database: myDatabase,
  columns: [{
    name: 'col1',
    type: glue.Schema.STRING,
  }],
  dataFormat: glue.DataFormat.JSON,
});
```

## Properties

- `key`: string

- `value`: string

## Methods

- `columnCountMismatchHandling(value: ColumnCountMismatchHandlingAction): StorageParameter // chainable` (static) — Identifies if the file contains less or more values for a row than the number of columns specified in the external table definition.

  This property is only available for an uncompressed text file format.

- `compressionType(value: CompressionType): StorageParameter // chainable` (static) — The type of compression used on the table, when the file name does not contain an extension.

  This value overrides the compression type specified through the extension.

- `custom(key: string, value: string): StorageParameter // chainable` (static) — A custom storage parameter.

  **Parameters**

  - `key` — - The key of the storage parameter.
  - `value` — - The value of the storage parameter.

- `dataCleansingEnabled(value: boolean): StorageParameter // chainable` (static) — Determines whether data handling is on for the table.

- `invalidCharHandling(value: InvalidCharHandlingAction): StorageParameter // chainable` (static) — Specifies the action to perform when query results contain invalid UTF-8 character values.

- `numericOverflowHandling(value: NumericOverflowHandlingAction): StorageParameter // chainable` (static) — Specifies the action to perform when ORC data contains an integer (for example, BIGINT or int64) that is larger than the column definition (for example, SMALLINT or int16).

- `numRows(value: number): StorageParameter // chainable` (static) — A property that sets the numRows value for the table definition.

  To explicitly update an external table's statistics, set the numRows property to indicate the size of the table. Amazon Redshift doesn't analyze external tables to generate the table statistics that the query optimizer uses to generate a query plan. If table statistics aren't set for an external table, Amazon Redshift generates a query execution plan based on an assumption that external tables are the larger tables and local tables are the smaller tables.

- `orcSchemaResolution(value: OrcColumnMappingType): StorageParameter // chainable` (static) — A property that sets the column mapping type for tables that use ORC data format.

  This property is ignored for other data formats. If this property is omitted, columns are mapped by `OrcColumnMappingType.NAME` by default.

- `replacementChar(value: string): StorageParameter // chainable` (static) — Specifies the replacement character to use when you set `INVALID_CHAR_HANDLING` to `REPLACE`.

- `serializationNullFormat(value: string): StorageParameter // chainable` (static) — A property that sets number of rows to skip at the beginning of each source file.

- `skipHeaderLineCount(value: number): StorageParameter // chainable` (static) — The number of rows to skip at the top of a CSV file when the table is being created.

- `surplusBytesHandling(value: SurplusBytesHandlingAction): StorageParameter // chainable` (static) — Specifies how to handle data being loaded that exceeds the length of the data type defined for columns containing VARBYTE data.

  By default, Redshift Spectrum sets the value to null for data that exceeds the width of the column.

- `surplusCharHandling(value: SurplusCharHandlingAction): StorageParameter // chainable` (static) — Specifies how to handle data being loaded that exceeds the length of the data type defined for columns containing VARCHAR, CHAR, or string data.

  By default, Redshift Spectrum sets the value to null for data that exceeds the width of the column.

- `writeKmsKeyId(key: IKeyRef): StorageParameter // chainable` (static) — Enables server-side encryption (SSE-KMS) with the given AWS KMS key on the files Redshift Spectrum writes for this table (via `CREATE EXTERNAL TABLE AS` or `INSERT`).

  Redshift Spectrum accepts either the key's ARN or its bare key ID for the
  `write.kms.key.id` property, and encrypts the written objects with that key;
  this renders the ARN. To use the S3 bucket's default KMS key instead, set the
  literal value `auto` via `StorageParameter.custom('write.kms.key.id', 'auto')` —
  this typed factory cannot express `auto`.

- `writeMaxFileSizeMb(value: number): StorageParameter // chainable` (static) — A property that sets the maximum size (in MB) of each file written to Amazon S3 by CREATE EXTERNAL TABLE AS.

  The size must be a valid integer between 5 and 6200. The default maximum file size is 6,200 MB. This table property also applies to any subsequent INSERT statement into the same external table.

- `writeParallel(value: WriteParallel): StorageParameter // chainable` (static) — A property that sets whether CREATE EXTERNAL TABLE AS should write data in parallel.

  When 'write.parallel' is set to off, CREATE EXTERNAL TABLE AS writes to one or more data files serially onto Amazon S3. This table property also applies to any subsequent INSERT statement into the same external table.
