{
  "$schema": "/products/haybarn/functions/api/v1/function.schema.json",
  "schemaVersion": 1,
  "name": "time_bucket",
  "schema": "main",
  "slug": "time_bucket",
  "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
  "category": "dates",
  "kinds": [
    "scalar"
  ],
  "aliasOf": [],
  "snapshot": {
    "schemaVersion": 1,
    "id": "duckdb-1.4.4",
    "engine": "duckdb",
    "label": "DuckDB 1.4.4",
    "engineVersion": "v1.4.4",
    "sourceId": "6ddac802ff",
    "source": "https://github.com/duckdb/duckdb/releases/tag/v1.4.4",
    "binarySha256": "8d05bee013ea13d6b5d75272d7ddb52b3d6d9cdaf30d1a3e8e82d42757905182",
    "capturedAt": "2026-09-05T18:37:36.091Z",
    "requestedExtensions": [
      "core_functions",
      "icu",
      "json",
      "parquet"
    ],
    "loadedExtensions": [
      {
        "extension_name": "autocomplete",
        "extension_version": "v1.4.4",
        "installed_from": ""
      },
      {
        "extension_name": "core_functions",
        "extension_version": "v1.4.4",
        "installed_from": ""
      },
      {
        "extension_name": "icu",
        "extension_version": "v1.4.4",
        "installed_from": ""
      },
      {
        "extension_name": "json",
        "extension_version": "v1.4.4",
        "installed_from": ""
      },
      {
        "extension_name": "parquet",
        "extension_version": "v1.4.4",
        "installed_from": ""
      },
      {
        "extension_name": "shell",
        "extension_version": "v1.4.4",
        "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.4.4/time_bucket/",
    "markdown": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/index.md",
    "json": "/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/time_bucket.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.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": [
    {
      "id": "overload-b6596338f21bcbd3",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-b6596338f21bcbd3",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: DATE) → DATE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "DATE",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "DATE",
        "parameters": [
          "bucket_width",
          "timestamp"
        ],
        "parameter_types": [
          "INTERVAL",
          "DATE"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-2b3e104eed391e2e",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-2b3e104eed391e2e",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP) → TIMESTAMP",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP",
        "parameters": [
          "bucket_width",
          "timestamp"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-ac6fdee616cafd71",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-ac6fdee616cafd71",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP WITH TIME ZONE) → TIMESTAMP WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE",
        "parameters": [
          "bucket_width",
          "timestamp"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP WITH TIME ZONE"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-6fb065f234d1d57e",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-6fb065f234d1d57e",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: DATE, origin: DATE) → DATE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "DATE",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "DATE",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "DATE",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "DATE",
          "DATE"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-7f02bd778223fe63",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-7f02bd778223fe63",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: DATE, origin: INTERVAL) → DATE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "DATE",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "DATE",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "DATE",
          "INTERVAL"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-a37249ce9911f6ff",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-a37249ce9911f6ff",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP WITH TIME ZONE, origin: INTERVAL) → TIMESTAMP WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP WITH TIME ZONE",
          "INTERVAL"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-ccec5d7efa87d6c1",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-ccec5d7efa87d6c1",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP WITH TIME ZONE, origin: TIMESTAMP WITH TIME ZONE) → TIMESTAMP WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP WITH TIME ZONE",
          "TIMESTAMP WITH TIME ZONE"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-2f2f313bae901dfe",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-2f2f313bae901dfe",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP WITH TIME ZONE, origin: VARCHAR) → TIMESTAMP WITH TIME ZONE",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP WITH TIME ZONE",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "VARCHAR",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP WITH TIME ZONE",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP WITH TIME ZONE",
          "VARCHAR"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-d2ec6563944eb926",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-d2ec6563944eb926",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP, origin: INTERVAL) → TIMESTAMP",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP",
          "INTERVAL"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-2069b0043ac5c870",
      "url": "/products/haybarn/functions/releases/duckdb-1.4.4/time_bucket/#overload-2069b0043ac5c870",
      "signature": "time_bucket(bucket_width: INTERVAL, timestamp: TIMESTAMP, origin: TIMESTAMP) → TIMESTAMP",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "bucket_width",
            "type": "INTERVAL",
            "mode": null,
            "position": null
          },
          {
            "name": "timestamp",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          },
          {
            "name": "origin",
            "type": "TIMESTAMP",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "function",
        "operator": null
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "time_bucket",
        "function_type": "scalar",
        "description": "Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets",
        "comment": null,
        "return_type": "TIMESTAMP",
        "parameters": [
          "bucket_width",
          "timestamp",
          "origin"
        ],
        "parameter_types": [
          "INTERVAL",
          "TIMESTAMP",
          "TIMESTAMP"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    }
  ],
  "editorial": {
    "argumentNotes": [],
    "recipes": []
  },
  "examples": [
    {
      "original": "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')",
      "sql": "SELECT time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07');",
      "overloadIds": [
        "overload-b6596338f21bcbd3",
        "overload-2b3e104eed391e2e",
        "overload-ac6fdee616cafd71",
        "overload-6fb065f234d1d57e",
        "overload-7f02bd778223fe63",
        "overload-a37249ce9911f6ff",
        "overload-ccec5d7efa87d6c1",
        "overload-2f2f313bae901dfe",
        "overload-d2ec6563944eb926",
        "overload-2069b0043ac5c870"
      ],
      "source": "engine-catalog",
      "verification": null
    }
  ],
  "translations": [
    {
      "function": "time_bucket",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "PostgreSQL",
        "dialect": "postgres",
        "name": "",
        "names": [
          "date_bin",
          "min"
        ],
        "sql": "SELECT DATE_BIN('30 days', timestamp_col, (SELECT MIN(TIMESTAMP) from table)) FROM table"
      },
      "target": {
        "dialect": "duckdb",
        "name": "time_bucket",
        "sql": "SELECT TIME_BUCKET('30 days', timestamp_col, (SELECT MIN(TIMESTAMP) FROM \"table\")) FROM \"table\""
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_postgres.py#L1098"
      }
    },
    {
      "function": "time_bucket",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "Snowflake",
        "dialect": "snowflake",
        "name": "time_slice",
        "names": [
          "time_slice"
        ],
        "sql": "SELECT TIME_SLICE(DATE '2024-03-15', 1, 'DAY')"
      },
      "target": {
        "dialect": "duckdb",
        "name": "time_bucket",
        "sql": "SELECT TIME_BUCKET(INTERVAL 1 DAY, CAST('2024-03-15' AS DATE))"
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_snowflake.py#L3045"
      }
    }
  ],
  "runnableExamples": [
    {
      "function": "time_bucket",
      "original": "time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')",
      "sql": "SELECT time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07');",
      "source": "engine-catalog",
      "verification": {
        "engine": "haybarn-wasm",
        "packageVersion": "1.5.5-rc3",
        "sourceId": "105edd31b5",
        "binarySha256": "426638bc374fcc542fea93b251f885bfb7d221c68fcc0a5a81cc565d7e6ca180",
        "rowCount": 1
      }
    }
  ],
  "additionalDocumentation": [
    {
      "title": "Date Functions",
      "url": "https://duckdb.org/docs/current/sql/functions/date#time_bucketbucket_width-date-origin"
    },
    {
      "title": "Timestamp Functions",
      "url": "https://duckdb.org/docs/current/sql/functions/timestamp#time_bucketbucket_width-timestamp-origin"
    },
    {
      "title": "Timestamp with Time Zone Functions",
      "url": "https://duckdb.org/docs/current/sql/functions/timestamptz#time_bucketbucket_width-timestamptz-timezone"
    }
  ],
  "availability": [
    {
      "snapshot": "haybarn-1.5.5-rc3",
      "observed": true,
      "overloadCount": 10,
      "matchingOverloadIds": [
        "overload-6fb065f234d1d57e",
        "overload-7f02bd778223fe63",
        "overload-b6596338f21bcbd3",
        "overload-a37249ce9911f6ff",
        "overload-ccec5d7efa87d6c1",
        "overload-2f2f313bae901dfe",
        "overload-ac6fdee616cafd71",
        "overload-d2ec6563944eb926",
        "overload-2069b0043ac5c870",
        "overload-2b3e104eed391e2e"
      ],
      "json": "/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/time_bucket.json"
    },
    {
      "snapshot": "duckdb-1.5.5",
      "observed": true,
      "overloadCount": 10,
      "matchingOverloadIds": [
        "overload-6fb065f234d1d57e",
        "overload-7f02bd778223fe63",
        "overload-b6596338f21bcbd3",
        "overload-a37249ce9911f6ff",
        "overload-ccec5d7efa87d6c1",
        "overload-2f2f313bae901dfe",
        "overload-ac6fdee616cafd71",
        "overload-d2ec6563944eb926",
        "overload-2069b0043ac5c870",
        "overload-2b3e104eed391e2e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/time_bucket.json"
    },
    {
      "snapshot": "duckdb-1.4.4",
      "observed": true,
      "overloadCount": 10,
      "matchingOverloadIds": [
        "overload-6fb065f234d1d57e",
        "overload-7f02bd778223fe63",
        "overload-b6596338f21bcbd3",
        "overload-a37249ce9911f6ff",
        "overload-ccec5d7efa87d6c1",
        "overload-2f2f313bae901dfe",
        "overload-ac6fdee616cafd71",
        "overload-d2ec6563944eb926",
        "overload-2069b0043ac5c870",
        "overload-2b3e104eed391e2e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/time_bucket.json"
    },
    {
      "snapshot": "duckdb-1.3.2",
      "observed": true,
      "overloadCount": 10,
      "matchingOverloadIds": [
        "overload-6fb065f234d1d57e",
        "overload-7f02bd778223fe63",
        "overload-b6596338f21bcbd3",
        "overload-a37249ce9911f6ff",
        "overload-ccec5d7efa87d6c1",
        "overload-2f2f313bae901dfe",
        "overload-ac6fdee616cafd71",
        "overload-d2ec6563944eb926",
        "overload-2069b0043ac5c870",
        "overload-2b3e104eed391e2e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/time_bucket.json"
    }
  ]
}
