Skip to content

Cubestore Does Not Support timestamp(6) in Pre-Aggregations #9843

@dvnatanael

Description

@dvnatanael

Describe the bug
Similar to #5536, building pre-aggregations using trino as a data source fails whenever a field of type: time are present, with the following error message:

Error during create table: CREATE TABLE <REDACTED>: Internal: ParserError("Expected ',' or ')' after column definition, found: (")

To Reproduce
Steps to reproduce the behavior:

  1. Create the attached data model.
  2. Launch cube.
  3. Wait for cube to start building pre-aggregations.
  4. See error.

Expected behavior
Cubestore successfully builds the pre-aggregation.

Minimally reproducible Cube Schema

cubes:
  - name: orders
    sql: |
      SELECT 1 as user_id, 2025-01-01T00:00:00.000+00 as created_at
      UNION ALL
      SELECT 1 as user_id, 2025-01-02T00:00:00.000+00 as created_at
      UNION ALL
      SELECT 2 as user_id, 2025-01-01T00:00:00.000+00 as created_at

    pre_aggregations:
      - name: first_order_by_user_id
        measures:
          - CUBE.first_order
        dimensions:
          - CUBE.user_id
        time_dimension: CUBE.created_at
        granularity: day

    measures:
      - name: first_order
        type: min
        sql: created_at

    dimensions:
      - name: user_id
        sql: user_id
        type: number

      - name: created_at
        sql: created_at
        type: time

Version:
v1.3.46

Additional Context

In this case, cubestore receives timestamp(6) instead of timestamp when querying for information schemas. The fix should be very similar to #6324, i.e. adding the following to the GenericTypeToCubeStore map:

    timestamp(6): timestamp

As a workaround, it is possible to cast(created_at as timestamp(3)) in the data model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cube storeIssues relating to Cube Store

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions