# Type

The type of a column in a table schema.

Instances are opaque: obtain one from a `Schema` factory (for example
`Schema.STRING`, `Schema.decimal(...)`, `Schema.array(...)`) or, for a type the
`Schema` factories don't model, from `Schema.custom(...)`.

Obtainable from: [Schema.BIG_INT](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#big-int), [Schema.BINARY](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#binary), [Schema.BOOLEAN](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#boolean), [Schema.DATE](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#date), [Schema.DOUBLE](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#double), [Schema.FLOAT](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#float), [Schema.INTEGER](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#integer), [Schema.SMALL_INT](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#small-int), [Schema.STRING](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#string), [Schema.TIMESTAMP](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#timestamp), [Schema.TINY_INT](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#tiny-int), [Schema.array](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#array), [Schema.char](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#char), [Schema.custom](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#custom), [Schema.decimal](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#decimal), [Schema.map](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#map), [Schema.struct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#struct), [Schema.varchar](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#varchar)
Used as argument in: [Schema.array](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#array), [Schema.map](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Schema.html#map)

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

## Example

TypeScript:

```ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
  database: myDatabase,
  columns: [{
    name: 'data',
    type: glue.Schema.STRING,
  }],
  partitionKeys: [{
    name: 'date',
    type: glue.Schema.STRING,
  }],
  dataFormat: glue.DataFormat.JSON,
  partitionProjection: {
    date: glue.PartitionProjectionConfiguration.date({
      min: 'NOW-3YEARS',
      max: 'NOW',
      format: 'yyyy-MM-dd',
    }),
  },
});
```

Python:

```python
# my_database: glue.Database

glue.S3Table(self, "MyTable",
    database=my_database,
    columns=[glue.Column(
        name="data",
        type=glue.Schema.STRING
    )],
    partition_keys=[glue.Column(
        name="date",
        type=glue.Schema.STRING
    )],
    data_format=glue.DataFormat.JSON,
    partition_projection={
        "date": glue.PartitionProjectionConfiguration.date(
            min="NOW-3YEARS",
            max="NOW",
            format="yyyy-MM-dd"
        )
    }
)
```

Java:

```java
Database myDatabase;

S3Table.Builder.create(this, "MyTable")
        .database(myDatabase)
        .columns(List.of(Column.builder()
                .name("data")
                .type(Schema.STRING)
                .build()))
        .partitionKeys(List.of(Column.builder()
                .name("date")
                .type(Schema.STRING)
                .build()))
        .dataFormat(DataFormat.JSON)
        .partitionProjection(Map.of(
                "date", PartitionProjectionConfiguration.date(DatePartitionProjectionConfigurationProps.builder()
                        .min("NOW-3YEARS")
                        .max("NOW")
                        .format("yyyy-MM-dd")
                        .build())))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Database myDatabase;

new S3Table(this, "MyTable", new S3TableProps {
    Database = myDatabase,
    Columns = new [] { new Column {
        Name = "data",
        Type = Schema.STRING
    } },
    PartitionKeys = new [] { new Column {
        Name = "date",
        Type = Schema.STRING
    } },
    DataFormat = DataFormat.JSON,
    PartitionProjection = new Dictionary<string, PartitionProjectionConfiguration> {
        { "date", PartitionProjectionConfiguration.Date(new DatePartitionProjectionConfigurationProps {
            Min = "NOW-3YEARS",
            Max = "NOW",
            Format = "yyyy-MM-dd"
        }) }
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myDatabase Database

glue.NewS3Table(this, jsii.String("MyTable"), &S3TableProps{
	Database: myDatabase,
	Columns: []Column{
		&Column{
			Name: jsii.String("data"),
			Type: glue.Schema_STRING(),
		},
	},
	PartitionKeys: []Column{
		&Column{
			Name: jsii.String("date"),
			Type: glue.Schema_STRING(),
		},
	},
	DataFormat: glue.DataFormat_JSON(),
	PartitionProjection: map[string]PartitionProjectionConfiguration{
		"date": glue.PartitionProjectionConfiguration_date(&DatePartitionProjectionConfigurationProps{
			"min": jsii.String("NOW-3YEARS"),
			"max": jsii.String("NOW"),
			"format": jsii.String("yyyy-MM-dd"),
		}),
	},
})
```

## Properties

- `inputString`: string — Glue InputString for this type.

- `isPrimitive`: boolean — Indicates whether this type is a primitive data type.
