# Schema

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

## Example

```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',
    }),
  },
});
```

## Initializer

```ts
new Schema()
```

## Properties

- `BIG_INT`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — A 64-bit signed INTEGER in two’s complement format, with a minimum value of -2^63 and a maximum value of 2^63-1.

- `BINARY`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static)

- `BOOLEAN`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static)

- `DATE`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — Date type.

- `DOUBLE`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static)

- `FLOAT`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static)

- `INTEGER`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — A 32-bit signed INTEGER in two’s complement format, with a minimum value of -2^31 and a maximum value of 2^31-1.

- `SMALL_INT`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — A 16-bit signed INTEGER in two’s complement format, with a minimum value of -2^15 and a maximum value of 2^15-1.

- `STRING`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — Arbitrary-length string type.

- `TIMESTAMP`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — Timestamp type (date and time).

- `TINY_INT`: [Type](/cdk/api/v2/docs/@aws-cdk_aws-glue-alpha.Type.html) (required) (static) — A 8-bit signed INTEGER in two’s complement format, with a minimum value of -2^7 and a maximum value of 2^7-1.

## Methods

- `array(itemType: Type): Type` (static) — Creates an array of some other type.

  **Parameters**

  - `itemType` — type contained by the array.

- `char(length: number): Type` (static) — Fixed length character data, with a specified length between 1 and 255.

  **Parameters**

  - `length` — length between 1 and 255.

- `custom(inputString: string, isPrimitive?: boolean): Type` (static) — Creates a custom type from a raw Glue input string.

  Escape hatch for column types the other `Schema` factories don't model. The
  `inputString` is emitted verbatim and is not validated.

  **Parameters**

  - `inputString` — the Glue input string for the type (for example `interval_day_to_second`).
  - `isPrimitive` — whether the type is a primitive (non-nested) data type.

- `decimal(precision: number, scale?: number): Type` (static) — Creates a decimal type.

  **Parameters**

  - `precision` — the total number of digits, between 1 and 38.
  - `scale` — the number of digits in the fractional part, between 0 and 38;

- `map(keyType: Type, valueType: Type): Type` (static) — Creates a map of some primitive key type to some value type.

  **Parameters**

  - `keyType` — type of key, must be a primitive.
  - `valueType` — type fo the value indexed by the key.

- `struct(columns: Column[]): Type` (static) — Creates a nested structure containing individually named and typed columns.

  **Parameters**

  - `columns` — the columns of the structure.

- `varchar(length: number): Type` (static) — Variable length character data, with a specified length between 1 and 65535.

  **Parameters**

  - `length` — length between 1 and 65535.
