# DataFormat

Defines the input/output formats and ser/de for a single DataFormat.

- Source: [`aws-glue/lib/data-format.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-glue/lib/data-format.ts#L209)
- Type last changed: v2.270.0 · 17 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 DataFormat(props: DataFormatProps)
```

## Properties

- `APACHE_LOGS`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for Apache Web Server Logs.

  Also works for CloudFront logs

- `AVRO`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for Apache Avro.

- `classificationString`: [ClassificationString](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.ClassificationString.html) — Classification string given to tables with this data format.

- `CLOUDTRAIL_LOGS`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for CloudTrail logs stored on S3.

- `CSV`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for CSV Files.

- `inputFormat`: [InputFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.InputFormat.html) — `InputFormat` for this data format.

- `JSON`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — Stored as plain text files in JSON format.

  Uses OpenX Json SerDe for serialization and deseralization.

- `LOGSTASH`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for Logstash Logs, using the GROK SerDe.

- `ORC`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for Apache ORC (Optimized Row Columnar).

- `outputFormat`: [OutputFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.OutputFormat.html) — `OutputFormat` for this data format.

- `PARQUET`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for Apache Parquet.

- `serializationLibrary`: [SerializationLibrary](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.SerializationLibrary.html) — Serialization library for this data format.

- `TSV`: [DataFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (static) — DataFormat for TSV (Tab-Separated Values).
