Skip to content

Renew cycle fails on named-timezone timestamp pushdown #11100

Description

@mattheworford

Describe the bug
During the renew cycle, Cube can fail when a SQL API-generated query contains a TIMESTAMP WITH TIME ZONE literal using an IANA timezone name such as America/Los_Angeles. The query is pushed down with the raw timestamp string, and Snowflake rejects it:

Error during renew cycle
Timestamp '2026-06-14T00:00:00 America/Los_Angeles' is not recognized

To Reproduce
Steps to reproduce the behavior:

  1. Connect to Cube through the SQL API.
  2. Run a query with a pushed-down timestamp filter using an IANA timezone name, for example:
SELECT
  customer_gender
FROM KibanaSampleDataEcommerce
WHERE
  order_date >= TIMESTAMP WITH TIME ZONE '2026-06-14T00:00:00 America/Los_Angeles'
  AND LOWER(customer_gender) = 'male'
GROUP BY 1;
  1. Use a Snowflake-backed Cube deployment.
  2. See an error similar to:
Error: Timestamp '2026-06-14T00:00:00 America/Los_Angeles' is not recognized

Expected behavior
Cube SQL should generate a valid timestamp-with-time-zone literal or equivalent downstream SQL. For example, the named timezone should be normalized to a numeric offset:

timestamptz '2026-06-14T00:00:00.000-07:00'

rather than passing the raw America/Los_Angeles string into a timestamp cast.

Screenshots
N/A

Minimally reproducible Cube Schema

cube(`Orders`, {
  sql: `
    select 1 as id, '2026-06-14 00:00:00' as created_at, 'male' as gender
    UNION ALL
    select 2 as id, '2026-06-15 00:00:00' as created_at, 'female' as gender
  `,
  measures: {
    count: {
      type: `count`,
    },
  },
  dimensions: {
    createdAt: {
      sql: `created_at`,
      type: `time`,
    },
    gender: {
      sql: `gender`,
      type: `string`,
    },
  },
});

Version:
1.6.57

Additional context
This appears in the SQL API path when the planner cannot fold the timestamp string into a timestamp literal. The wrapper then emits CAST($1 AS TIMESTAMP) and keeps the named timezone string as the parameter value, which Snowflake does not accept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions