# TableBaseProps

Used as props by: [TableBase](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.TableBase.html)

- Source: [`aws-glue/lib/table-base.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-glue/lib/table-base.ts#L52)
- Type last changed: v2.270.0 · 17 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';

declare const database: glue.Database;
declare const dataFormat: glue.DataFormat;
declare const partitionProjectionConfiguration: glue.PartitionProjectionConfiguration;
declare const storageParameter: glue.StorageParameter;
declare const type: glue.Type;
const tableBaseProps: glue.TableBaseProps = {
  columns: [{
    name: 'name',
    type: type,

    // the properties below are optional
    comment: 'comment',
  }],
  database: database,
  dataFormat: dataFormat,

  // the properties below are optional
  compressed: false,
  description: 'description',
  enablePartitionFiltering: false,
  hasEncryptedData: false,
  parameters: {
    parametersKey: 'parameters',
  },
  partitionIndexes: [{
    keyNames: ['keyNames'],

    // the properties below are optional
    indexName: 'indexName',
  }],
  partitionKeys: [{
    name: 'name',
    type: type,

    // the properties below are optional
    comment: 'comment',
  }],
  partitionProjection: {
    partitionProjectionKey: partitionProjectionConfiguration,
  },
  storageParameters: [storageParameter],
  storedAsSubDirectories: false,
  tableName: 'tableName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_glue as glue

# database: glue.Database
# data_format: glue.DataFormat
# partition_projection_configuration: glue.PartitionProjectionConfiguration
# storage_parameter: glue.StorageParameter
# type: glue.Type

table_base_props = glue.TableBaseProps(
    columns=[glue.Column(
        name="name",
        type=type,

        # the properties below are optional
        comment="comment"
    )],
    database=database,
    data_format=data_format,

    # the properties below are optional
    compressed=False,
    description="description",
    enable_partition_filtering=False,
    has_encrypted_data=False,
    parameters={
        "parameters_key": "parameters"
    },
    partition_indexes=[glue.PartitionIndex(
        key_names=["keyNames"],

        # the properties below are optional
        index_name="indexName"
    )],
    partition_keys=[glue.Column(
        name="name",
        type=type,

        # the properties below are optional
        comment="comment"
    )],
    partition_projection={
        "partition_projection_key": partition_projection_configuration
    },
    storage_parameters=[storage_parameter],
    stored_as_sub_directories=False,
    table_name="tableName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.glue.*;

Database database;
DataFormat dataFormat;
PartitionProjectionConfiguration partitionProjectionConfiguration;
StorageParameter storageParameter;
Type type;

TableBaseProps tableBaseProps = TableBaseProps.builder()
        .columns(List.of(Column.builder()
                .name("name")
                .type(type)

                // the properties below are optional
                .comment("comment")
                .build()))
        .database(database)
        .dataFormat(dataFormat)

        // the properties below are optional
        .compressed(false)
        .description("description")
        .enablePartitionFiltering(false)
        .hasEncryptedData(false)
        .parameters(Map.of(
                "parametersKey", "parameters"))
        .partitionIndexes(List.of(PartitionIndex.builder()
                .keyNames(List.of("keyNames"))

                // the properties below are optional
                .indexName("indexName")
                .build()))
        .partitionKeys(List.of(Column.builder()
                .name("name")
                .type(type)

                // the properties below are optional
                .comment("comment")
                .build()))
        .partitionProjection(Map.of(
                "partitionProjectionKey", partitionProjectionConfiguration))
        .storageParameters(List.of(storageParameter))
        .storedAsSubDirectories(false)
        .tableName("tableName")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue;

Database database;
DataFormat dataFormat;
PartitionProjectionConfiguration partitionProjectionConfiguration;
StorageParameter storageParameter;
Type type;

var tableBaseProps = new TableBaseProps {
    Columns = new [] { new Column {
        Name = "name",
        Type = type,

        // the properties below are optional
        Comment = "comment"
    } },
    Database = database,
    DataFormat = dataFormat,

    // the properties below are optional
    Compressed = false,
    Description = "description",
    EnablePartitionFiltering = false,
    HasEncryptedData = false,
    Parameters = new Dictionary<string, string> {
        { "parametersKey", "parameters" }
    },
    PartitionIndexes = new [] { new PartitionIndex {
        KeyNames = new [] { "keyNames" },

        // the properties below are optional
        IndexName = "indexName"
    } },
    PartitionKeys = new [] { new Column {
        Name = "name",
        Type = type,

        // the properties below are optional
        Comment = "comment"
    } },
    PartitionProjection = new Dictionary<string, PartitionProjectionConfiguration> {
        { "partitionProjectionKey", partitionProjectionConfiguration }
    },
    StorageParameters = new [] { storageParameter },
    StoredAsSubDirectories = false,
    TableName = "tableName"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var database Database
var dataFormat DataFormat
var partitionProjectionConfiguration PartitionProjectionConfiguration
var storageParameter StorageParameter
var type Type

tableBaseProps := &TableBaseProps{
	Columns: []Column{
		&Column{
			Name: jsii.String("name"),
			Type: type,

			// the properties below are optional
			Comment: jsii.String("comment"),
		},
	},
	Database: database,
	DataFormat: dataFormat,

	// the properties below are optional
	Compressed: jsii.Boolean(false),
	Description: jsii.String("description"),
	EnablePartitionFiltering: jsii.Boolean(false),
	HasEncryptedData: jsii.Boolean(false),
	Parameters: map[string]*string{
		"parametersKey": jsii.String("parameters"),
	},
	PartitionIndexes: []PartitionIndex{
		&PartitionIndex{
			KeyNames: []*string{
				jsii.String("keyNames"),
			},

			// the properties below are optional
			IndexName: jsii.String("indexName"),
		},
	},
	PartitionKeys: []Column{
		&Column{
			Name: jsii.String("name"),
			Type: type,

			// the properties below are optional
			Comment: jsii.String("comment"),
		},
	},
	PartitionProjection: map[string]PartitionProjectionConfiguration{
		"partitionProjectionKey": partitionProjectionConfiguration,
	},
	StorageParameters: []StorageParameter{
		storageParameter,
	},
	StoredAsSubDirectories: jsii.Boolean(false),
	TableName: jsii.String("tableName"),
}
```

## Properties

- `columns`: [Column](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Column.html)[] (required) — Columns of the table.

- `compressed`: boolean = false — Indicates whether the table's data is compressed or not.

- `database`: [IDatabase](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.IDatabase.html) (required) — Database in which to store the table.

- `dataFormat`: [DataFormat](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (required) — Storage type of the table's data.

- `description`: string = generated — Description of the table.

- `enablePartitionFiltering`: boolean — Enables partition filtering.

  **Default:** The parameter is not defined

- `hasEncryptedData`: boolean = true — Whether the data stored in the table is encrypted.

  This sets the `has_encrypted_data` table parameter. Athena reads it when
  querying client-side (CSE-KMS) encrypted datasets; for server-side
  encrypted (SSE-S3 / SSE-KMS) or unencrypted data it has no effect, since
  Amazon S3 decrypts server-side encrypted objects transparently.

  Do not also set `has_encrypted_data` through `parameters` - use this
  property instead. A conflicting value in `parameters` is rejected.

- `parameters`: { [key: string]: string } — The key/value pairs define properties associated with the table.

  **Default:** The parameter is not defined

  The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

- `partitionIndexes`: [PartitionIndex](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.PartitionIndex.html)[] — Partition indexes on the table.

  **Default:** table has no partition indexes

  A maximum of 3 indexes
  are allowed on a table. Keys in the index must be part
  of the table's partition keys.

- `partitionKeys`: [Column](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Column.html)[] — Partition columns of the table.

  **Default:** table is not partitioned

- `partitionProjection`: { [key: string]: [PartitionProjectionConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.PartitionProjectionConfiguration.html) } — Partition projection configuration for this table.

  **Default:** No partition projection

  Partition projection allows Athena to automatically add new partitions
  without requiring `ALTER TABLE ADD PARTITION` statements.

- `storageParameters`: [StorageParameter](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.StorageParameter.html)[] — The user-supplied properties for the description of the physical storage of this table.

  **Default:** The parameter is not defined

  These properties help describe the format of the data that is stored within the crawled data sources.

  The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

  Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.

  ```ts
     declare const glueDatabase: glue.IDatabase;
     const table = new glue.S3Table(this, 'Table', {
       storageParameters: [
           glue.StorageParameter.skipHeaderLineCount(1),
           glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
           glue.StorageParameter.custom('foo', 'bar'), // Will have no effect
           glue.StorageParameter.custom('separatorChar', ','), // Will describe the separator char used in the data
           glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, 'off'),
       ],
       // ...
       database: glueDatabase,
       columns: [{
           name: 'col1',
           type: glue.Schema.STRING,
       }],
       dataFormat: glue.DataFormat.CSV,
     });
  ```

- `storedAsSubDirectories`: boolean = false — Indicates whether the table data is stored in subdirectories.

- `tableName`: string — Name of the table.

  **Default:** generated by CDK.
