# approx_quantile — DuckDB 1.3.2

Computes the approximate quantile using T-Digest.

- Reference: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/
- JSON: /products/haybarn/functions/api/v1/duckdb-1.3.2/functions/approx_quantile.json
- Snapshot ID: duckdb-1.3.2
- Engine: duckdb v1.3.2
- Source ID: 0b83e5d2f6
- Binary SHA-256: 9a2ae2a4d5dbd07a5b0cb30c502d65014825d34924c681eb3faa7647e7cd2b6f
- Captured: 2026-09-05T18:37:33.818Z
- Source: https://github.com/duckdb/duckdb/releases/tag/v1.3.2
- Loaded extensions: autocomplete, core_functions, icu, json, parquet, shell

## Interpretation

- Choose a snapshot matching the target engine and build. The default is captured from the published Haybarn WASM package used by the browser playground. Historical native snapshots are also available.
- Availability is an observation in the recorded build and extension profile, not a guarantee of support in every installation or in WASM.
- Types and descriptions are declarations from duckdb_functions(). Binding can specialize result types. Null means not supplied by the catalog; do not invent defaults, optionality, argument mode, or table output columns.
- Raw parameter arrays preserve catalog order for scalar/aggregate/macro functions. Raw table arguments are alphabetical. Use callingConvention for engine-confirmed positional order and named arguments; null modes are unrecorded. Named does not mean optional. Macro defaults and special named variadic behavior are not supplied by duckdb_functions().
- Catalog examples are source material and may require data or extensions. runnableExamples contains separately verified SQL for the pinned WASM package; sample-data adaptations and guide examples are labeled separately.
- Guide annotations and recipes are separate editorial content. The browser runner always uses Haybarn WASM 1.5.5-rc3, independently of the documentation snapshot.
- All URLs beginning with / are relative to the origin hosting this document. Exports require no JavaScript, cookies, API key, or browser engine.

## Overloads

### overload-c2f1b53992539feb

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: BIGINT, pos: FLOAT) → BIGINT
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-c2f1b53992539feb

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | BIGINT | not recorded |
| pos | FLOAT | not recorded |

Declared return type: BIGINT. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-82a7c3976aa1e9a2

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: BIGINT, pos: FLOAT[]) → BIGINT[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-82a7c3976aa1e9a2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | BIGINT | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: BIGINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-d123c8e8828de057

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DATE, pos: FLOAT) → DATE
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-d123c8e8828de057

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DATE | not recorded |
| pos | FLOAT | not recorded |

Declared return type: DATE. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-80043d9ed0d1b491

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DATE, pos: FLOAT[]) → DATE[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-80043d9ed0d1b491

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DATE | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: DATE[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-80c93242a13f0c1b

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DECIMAL, pos: FLOAT) → DECIMAL
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-80c93242a13f0c1b

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DECIMAL | not recorded |
| pos | FLOAT | not recorded |

Declared return type: DECIMAL. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-5ee99ee3d377122f

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DECIMAL, pos: FLOAT[]) → DECIMAL[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-5ee99ee3d377122f

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DECIMAL | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: DECIMAL[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-432c1e5f5027140e

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DOUBLE, pos: FLOAT) → DOUBLE
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-432c1e5f5027140e

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DOUBLE | not recorded |
| pos | FLOAT | not recorded |

Declared return type: DOUBLE. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-b3287e466cc5bfb0

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: DOUBLE, pos: FLOAT[]) → DOUBLE[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-b3287e466cc5bfb0

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DOUBLE | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: DOUBLE[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-b3562e4a7427d280

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: FLOAT, pos: FLOAT[]) → FLOAT[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-b3562e4a7427d280

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | FLOAT | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: FLOAT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-aa49b076db5ea7f2

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: HUGEINT, pos: FLOAT) → HUGEINT
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-aa49b076db5ea7f2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | HUGEINT | not recorded |
| pos | FLOAT | not recorded |

Declared return type: HUGEINT. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-861cf685be5042a1

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: HUGEINT, pos: FLOAT[]) → HUGEINT[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-861cf685be5042a1

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | HUGEINT | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: HUGEINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-0135072f6a7be382

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: INTEGER, pos: FLOAT) → INTEGER
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-0135072f6a7be382

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | INTEGER | not recorded |
| pos | FLOAT | not recorded |

Declared return type: INTEGER. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-82513000fa740334

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: INTEGER, pos: FLOAT[]) → INTEGER[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-82513000fa740334

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | INTEGER | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: INTEGER[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-02db46853e29f5d0

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: SMALLINT, pos: FLOAT) → SMALLINT
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-02db46853e29f5d0

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | SMALLINT | not recorded |
| pos | FLOAT | not recorded |

Declared return type: SMALLINT. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-5c77fed865f4a61b

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: SMALLINT, pos: FLOAT[]) → SMALLINT[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-5c77fed865f4a61b

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | SMALLINT | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: SMALLINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-5148d75d600e85dc

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIME WITH TIME ZONE, pos: FLOAT) → TIME WITH TIME ZONE
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-5148d75d600e85dc

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIME WITH TIME ZONE | not recorded |
| pos | FLOAT | not recorded |

Declared return type: TIME WITH TIME ZONE. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-fbee9af4bc5ebc4b

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIME WITH TIME ZONE, pos: FLOAT[]) → TIME WITH TIME ZONE[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-fbee9af4bc5ebc4b

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIME WITH TIME ZONE | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: TIME WITH TIME ZONE[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-bab2e1259a0b2524

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIME, pos: FLOAT) → TIME
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-bab2e1259a0b2524

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIME | not recorded |
| pos | FLOAT | not recorded |

Declared return type: TIME. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-29971e967758b620

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIME, pos: FLOAT[]) → TIME[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-29971e967758b620

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIME | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: TIME[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-8e4dc42efe674788

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIMESTAMP WITH TIME ZONE, pos: FLOAT) → TIMESTAMP WITH TIME ZONE
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-8e4dc42efe674788

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP WITH TIME ZONE | not recorded |
| pos | FLOAT | not recorded |

Declared return type: TIMESTAMP WITH TIME ZONE. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-f8e54f60f0b31043

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIMESTAMP WITH TIME ZONE, pos: FLOAT[]) → TIMESTAMP WITH TIME ZONE[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-f8e54f60f0b31043

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP WITH TIME ZONE | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: TIMESTAMP WITH TIME ZONE[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-9b325a373556fe78

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIMESTAMP, pos: FLOAT) → TIMESTAMP
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-9b325a373556fe78

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP | not recorded |
| pos | FLOAT | not recorded |

Declared return type: TIMESTAMP. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-dbf5218fb06628c2

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TIMESTAMP, pos: FLOAT[]) → TIMESTAMP[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-dbf5218fb06628c2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: TIMESTAMP[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-651e562b269f5fac

Kind: aggregate. Parameter order: catalog-order.

```text
approx_quantile(x: TINYINT, pos: FLOAT[]) → TINYINT[]
```

Link: /products/haybarn/functions/releases/duckdb-1.3.2/approx_quantile/#overload-651e562b269f5fac

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TINYINT | not recorded |
| pos | FLOAT[] | not recorded |

Declared return type: TINYINT[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.


## Guide recipes

No guide recipes.

## Engine catalog examples

Source examples may require additional data or extensions. Expressions are wrapped in SELECT; execution verification is not recorded.

Reported for: overload-c2f1b53992539feb, overload-82a7c3976aa1e9a2, overload-d123c8e8828de057, overload-80043d9ed0d1b491, overload-80c93242a13f0c1b, overload-5ee99ee3d377122f, overload-432c1e5f5027140e, overload-b3287e466cc5bfb0, overload-b3562e4a7427d280, overload-aa49b076db5ea7f2, overload-861cf685be5042a1, overload-0135072f6a7be382, overload-82513000fa740334, overload-02db46853e29f5d0, overload-5c77fed865f4a61b, overload-5148d75d600e85dc, overload-fbee9af4bc5ebc4b, overload-bab2e1259a0b2524, overload-29971e967758b620, overload-8e4dc42efe674788, overload-f8e54f60f0b31043, overload-9b325a373556fe78, overload-dbf5218fb06628c2, overload-651e562b269f5fac

```sql
SELECT approx_quantile(x, 0.5);
```

## Runnable examples

Executed successfully in Haybarn WASM 1.5.5-rc3. Sample data and guide examples are separate from the original catalog.

```sql
SELECT approx_quantile(x, 0.5)
FROM (VALUES
  (10),
  (20),
  (NULL)
) AS sample("x");
```

## Additional DuckDB documentation

- [Aggregate Functions](https://duckdb.org/docs/current/sql/functions/aggregates#approximate-aggregates)

## In other engines

### Apache Hive: percentile_approx()



Apache Hive:

```sql
PERCENTILE_APPROX(x, 0.5)
```

Haybarn / DuckDB:

```sql
APPROX_QUANTILE(x, 0.5)
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_hive.py#L626).

### BigQuery: approx_quantiles()



BigQuery:

```sql
APPROX_QUANTILES(x, 1)
```

Haybarn / DuckDB:

```sql
APPROX_QUANTILE(x, [0, 1])
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_bigquery.py#L4134).

### Snowflake: approx_percentile()



Snowflake:

```sql
SELECT APPROX_PERCENTILE(a, 0.5) FROM t
```

Haybarn / DuckDB:

```sql
SELECT APPROX_QUANTILE(a, 0.5) FROM t
```

Translation from [SQLGlot](https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_duckdb.py#L2789).

## Observed availability

| Snapshot | Observed | Overloads | JSON |
| --- | --- | --- | --- |
| haybarn-1.5.5-rc3 | present | 24 | [reference](/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/approx_quantile.json) |
| duckdb-1.5.5 | present | 24 | [reference](/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/approx_quantile.json) |
| duckdb-1.4.4 | present | 24 | [reference](/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/approx_quantile.json) |
| duckdb-1.3.2 | present | 24 | [reference](/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/approx_quantile.json) |

Engine catalog documentation is derived from MIT-licensed Haybarn and DuckDB. [Notices](/third-party-notices.txt).
