<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLDataTable/Aggregator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML11MLDataTableV10AggregatorV"
  },
  "title" : "MLDataTable.Aggregator"
}
-->

# MLDataTable.Aggregator

A collection of column operations you can use with a data table’s
`group` method.

```
struct Aggregator
```

## Overview

Use one or more [`MLDataTable.Aggregator`](/documentation/CreateML/MLDataTable/Aggregator) instances when you use the
[`group(columnsNamed:aggregators:)`](/documentation/CreateML/MLDataTable/group(columnsNamed:aggregators:)) method. Each aggregator
performs a sequence of one or more
[`MLDataTable.Aggregator.Operations`](/documentation/CreateML/MLDataTable/Aggregator/Operations-swift.enum) for a single column.
Each operation makes a new column in the new data table generated by the
method.

## Topics

### Creating an aggregator

[`init(operations: MLDataTable.Aggregator.Operations..., of: String)`](/documentation/CreateML/MLDataTable/Aggregator/init(operations:of:))

Creates an aggregator with the given operations to perform on the
given column.

### Configuring an aggregator

[`var columnName: String`](/documentation/CreateML/MLDataTable/Aggregator/columnName)

The name of the column on which the aggregator performs operations
on.

[`var operations: [MLDataTable.Aggregator.Operations]`](/documentation/CreateML/MLDataTable/Aggregator/operations-swift.property)

An array of operations to perform on a column.

[`enum Operations`](/documentation/CreateML/MLDataTable/Aggregator/Operations-swift.enum)

The operations that an aggregator can perform on a column in a data
table.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)