---
title: "Set a dataset table's file-statistics setting"
method: PUT
path: "/v1/datasets/{id}/tables/{tableKey}/column-metrics"
tags: ["Datasets"]
---

# Set a dataset table's file-statistics setting

`PUT /v1/datasets/{id}/tables/{tableKey}/column-metrics`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/datasets/{id}/tables/{tableKey}/column-metrics`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Turns Grepr's default column statistics mode on or off for the table. On sets the table's write.metadata.metrics.default to truncate(16), replacing any other default; off removes it when it holds that value, and leaves a value set outside Grepr alone. Per-column modes are never changed. On costs about 18 bytes of table metadata per indexed column for each data file. Pipelines writing the dataset apply a change to new files by their next restart, and possibly sooner; files already written keep their statistics. Supported for logs_raw and spans_raw.

## Path parameters

- `id` string, required
- `tableKey` string, required

## Request body

- TableColumnMetricsUpdate
  - `enabled` boolean, required: Whether to turn Grepr's column statistics on for the table.

## Response `200`

The table's setting after the change.

- TableColumnMetrics
  - `enabled` boolean, required: Whether the table's default column statistics mode is Grepr's, which collects them on every column without a per-column mode, indexed columns past the first 100 included.
  - `mode` string: The table's write.metadata.metrics.default as stored, absent when the table has none. With the setting off, a value here was set outside Grepr.

## Other responses

- `404`: Dataset not found, or the table has no such setting.
- `409`: The table kept changing under the request, which running writers can cause; retry.
- `422`: The body is missing, or has no enabled field.

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
