{
  "$schema": "/products/haybarn/functions/api/v1/function.schema.json",
  "schemaVersion": 1,
  "name": "approx_quantile",
  "schema": "main",
  "slug": "approx_quantile",
  "description": "Computes the approximate quantile using T-Digest.",
  "category": "aggregate",
  "kinds": [
    "aggregate"
  ],
  "aliasOf": [],
  "snapshot": {
    "schemaVersion": 1,
    "id": "duckdb-1.5.6",
    "engine": "duckdb",
    "label": "DuckDB 1.5.6",
    "engineVersion": "v1.5.6",
    "sourceId": "069cc9f9b5",
    "source": "https://github.com/duckdb/duckdb/releases/tag/v1.5.6",
    "binarySha256": "2c75d4758c9d74cb0f4642f4e8d3c1a13e8a888a1e475fffd90934ad5ae3dd17",
    "capturedAt": "2026-10-15T15:04:49.978Z",
    "requestedExtensions": [
      "core_functions",
      "icu",
      "json",
      "parquet"
    ],
    "loadedExtensions": [
      {
        "extension_name": "autocomplete",
        "extension_version": "v1.5.6",
        "installed_from": ""
      },
      {
        "extension_name": "core_functions",
        "extension_version": "v1.5.6",
        "installed_from": "core"
      },
      {
        "extension_name": "icu",
        "extension_version": "v1.5.6",
        "installed_from": "core"
      },
      {
        "extension_name": "json",
        "extension_version": "v1.5.6",
        "installed_from": "core"
      },
      {
        "extension_name": "parquet",
        "extension_version": "v1.5.6",
        "installed_from": "core"
      },
      {
        "extension_name": "shell",
        "extension_version": "v1.5.6",
        "installed_from": ""
      }
    ],
    "scope": "Built-in functions in the main schema, with the requested extensions loaded. Catalog visibility is not a guarantee of browser support."
  },
  "links": {
    "html": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/",
    "markdown": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/index.md",
    "json": "/products/haybarn/functions/api/v1/duckdb-1.5.6/functions/approx_quantile.json"
  },
  "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.6-rc6, 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": [
    {
      "id": "overload-c2f1b53992539feb",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-c2f1b53992539feb",
      "signature": "approx_quantile(x: BIGINT, pos: FLOAT) → BIGINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "BIGINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "BIGINT",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "BIGINT",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-82a7c3976aa1e9a2",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-82a7c3976aa1e9a2",
      "signature": "approx_quantile(x: BIGINT, pos: FLOAT[]) → BIGINT[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "BIGINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "BIGINT[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "BIGINT",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-d123c8e8828de057",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-d123c8e8828de057",
      "signature": "approx_quantile(x: DATE, pos: FLOAT) → DATE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DATE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DATE",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DATE",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-80043d9ed0d1b491",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-80043d9ed0d1b491",
      "signature": "approx_quantile(x: DATE, pos: FLOAT[]) → DATE[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DATE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DATE[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DATE",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-80c93242a13f0c1b",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-80c93242a13f0c1b",
      "signature": "approx_quantile(x: DECIMAL, pos: FLOAT) → DECIMAL",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DECIMAL",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DECIMAL",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DECIMAL",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-5ee99ee3d377122f",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-5ee99ee3d377122f",
      "signature": "approx_quantile(x: DECIMAL, pos: FLOAT[]) → DECIMAL[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DECIMAL",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DECIMAL[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DECIMAL",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-432c1e5f5027140e",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-432c1e5f5027140e",
      "signature": "approx_quantile(x: DOUBLE, pos: FLOAT) → DOUBLE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DOUBLE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DOUBLE",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DOUBLE",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-b3287e466cc5bfb0",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-b3287e466cc5bfb0",
      "signature": "approx_quantile(x: DOUBLE, pos: FLOAT[]) → DOUBLE[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "DOUBLE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "DOUBLE[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "DOUBLE",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-b3562e4a7427d280",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-b3562e4a7427d280",
      "signature": "approx_quantile(x: FLOAT, pos: FLOAT[]) → FLOAT[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "FLOAT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "FLOAT[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "FLOAT",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-aa49b076db5ea7f2",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-aa49b076db5ea7f2",
      "signature": "approx_quantile(x: HUGEINT, pos: FLOAT) → HUGEINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "HUGEINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "HUGEINT",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "HUGEINT",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-861cf685be5042a1",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-861cf685be5042a1",
      "signature": "approx_quantile(x: HUGEINT, pos: FLOAT[]) → HUGEINT[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "HUGEINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "HUGEINT[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "HUGEINT",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-0135072f6a7be382",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-0135072f6a7be382",
      "signature": "approx_quantile(x: INTEGER, pos: FLOAT) → INTEGER",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "INTEGER",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "INTEGER",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "INTEGER",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-82513000fa740334",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-82513000fa740334",
      "signature": "approx_quantile(x: INTEGER, pos: FLOAT[]) → INTEGER[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "INTEGER",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "INTEGER[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "INTEGER",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-02db46853e29f5d0",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-02db46853e29f5d0",
      "signature": "approx_quantile(x: SMALLINT, pos: FLOAT) → SMALLINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "SMALLINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "SMALLINT",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "SMALLINT",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-5c77fed865f4a61b",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-5c77fed865f4a61b",
      "signature": "approx_quantile(x: SMALLINT, pos: FLOAT[]) → SMALLINT[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "SMALLINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "SMALLINT[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "SMALLINT",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-5148d75d600e85dc",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-5148d75d600e85dc",
      "signature": "approx_quantile(x: TIME WITH TIME ZONE, pos: FLOAT) → TIME WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIME WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIME WITH TIME ZONE",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIME WITH TIME ZONE",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-fbee9af4bc5ebc4b",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-fbee9af4bc5ebc4b",
      "signature": "approx_quantile(x: TIME WITH TIME ZONE, pos: FLOAT[]) → TIME WITH TIME ZONE[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIME WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIME WITH TIME ZONE[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIME WITH TIME ZONE",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-bab2e1259a0b2524",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-bab2e1259a0b2524",
      "signature": "approx_quantile(x: TIME, pos: FLOAT) → TIME",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIME",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIME",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIME",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-29971e967758b620",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-29971e967758b620",
      "signature": "approx_quantile(x: TIME, pos: FLOAT[]) → TIME[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIME",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIME[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIME",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-8e4dc42efe674788",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-8e4dc42efe674788",
      "signature": "approx_quantile(x: TIMESTAMP WITH TIME ZONE, pos: FLOAT) → TIMESTAMP WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIMESTAMP WITH TIME ZONE",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-f8e54f60f0b31043",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-f8e54f60f0b31043",
      "signature": "approx_quantile(x: TIMESTAMP WITH TIME ZONE, pos: FLOAT[]) → TIMESTAMP WITH TIME ZONE[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIMESTAMP WITH TIME ZONE",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-9b325a373556fe78",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-9b325a373556fe78",
      "signature": "approx_quantile(x: TIMESTAMP, pos: FLOAT) → TIMESTAMP",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIMESTAMP",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIMESTAMP",
          "FLOAT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-dbf5218fb06628c2",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-dbf5218fb06628c2",
      "signature": "approx_quantile(x: TIMESTAMP, pos: FLOAT[]) → TIMESTAMP[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TIMESTAMP[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TIMESTAMP",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-651e562b269f5fac",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.6/approx_quantile/#overload-651e562b269f5fac",
      "signature": "approx_quantile(x: TINYINT, pos: FLOAT[]) → TINYINT[]",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "x",
            "type": "TINYINT",
            "mode": null,
            "position": null
          },
          {
            "name": "pos",
            "type": "FLOAT[]",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "approx_quantile",
        "function_type": "aggregate",
        "description": "Computes the approximate quantile using T-Digest.",
        "comment": null,
        "return_type": "TINYINT[]",
        "parameters": [
          "x",
          "pos"
        ],
        "parameter_types": [
          "TINYINT",
          "FLOAT[]"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "approx_quantile(x, 0.5)"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    }
  ],
  "editorial": {
    "argumentNotes": [],
    "recipes": []
  },
  "examples": [
    {
      "original": "approx_quantile(x, 0.5)",
      "sql": "SELECT approx_quantile(x, 0.5);",
      "overloadIds": [
        "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"
      ],
      "source": "engine-catalog",
      "verification": null
    }
  ],
  "translations": [
    {
      "function": "approx_quantile",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "Apache Hive",
        "dialect": "hive",
        "name": "percentile_approx",
        "names": [
          "percentile_approx"
        ],
        "sql": "PERCENTILE_APPROX(x, 0.5)"
      },
      "target": {
        "dialect": "duckdb",
        "name": "approx_quantile",
        "sql": "APPROX_QUANTILE(x, 0.5)"
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_hive.py#L626"
      }
    },
    {
      "function": "approx_quantile",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "BigQuery",
        "dialect": "bigquery",
        "name": "approx_quantiles",
        "names": [
          "approx_quantiles"
        ],
        "sql": "APPROX_QUANTILES(x, 1)"
      },
      "target": {
        "dialect": "duckdb",
        "name": "approx_quantile",
        "sql": "APPROX_QUANTILE(x, [0, 1])"
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_bigquery.py#L4134"
      }
    },
    {
      "function": "approx_quantile",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "Snowflake",
        "dialect": "snowflake",
        "name": "approx_percentile",
        "names": [
          "approx_percentile"
        ],
        "sql": "SELECT APPROX_PERCENTILE(a, 0.5) FROM t"
      },
      "target": {
        "dialect": "duckdb",
        "name": "approx_quantile",
        "sql": "SELECT APPROX_QUANTILE(a, 0.5) FROM t"
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_duckdb.py#L2789"
      }
    }
  ],
  "runnableExamples": [
    {
      "function": "approx_quantile",
      "original": "approx_quantile(x, 0.5)",
      "sql": "SELECT approx_quantile(x, 0.5)\nFROM (VALUES\n  (10),\n  (20),\n  (NULL)\n) AS sample(\"x\");",
      "source": "catalog-with-sample-data",
      "verification": {
        "engine": "haybarn-wasm",
        "packageVersion": "1.5.6-rc6",
        "sourceId": "5b8b06dfbc",
        "binarySha256": "13bf09c19dd0f6b8748c0d3d5f0e0627679bae8b16befa728d8a1058ff0c85c9",
        "rowCount": 1
      }
    }
  ],
  "additionalDocumentation": [
    {
      "title": "Aggregate Functions",
      "url": "https://duckdb.org/docs/current/sql/functions/aggregates#approximate-aggregates"
    }
  ],
  "availability": [
    {
      "snapshot": "haybarn-1.5.6-rc6",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/haybarn-1.5.6-rc6/functions/approx_quantile.json"
    },
    {
      "snapshot": "haybarn-1.5.5-rc3",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/approx_quantile.json"
    },
    {
      "snapshot": "duckdb-1.5.6",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.5.6/functions/approx_quantile.json"
    },
    {
      "snapshot": "duckdb-1.5.5",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/approx_quantile.json"
    },
    {
      "snapshot": "duckdb-1.4.4",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/approx_quantile.json"
    },
    {
      "snapshot": "duckdb-1.3.2",
      "observed": true,
      "overloadCount": 24,
      "matchingOverloadIds": [
        "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"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/approx_quantile.json"
    }
  ]
}
