Skip to content

Numeric filter values passed as strings in DuckDB dialectΒ #9281

@igorlukanin

Description

@igorlukanin

Describe the bug
For a filter on a numeric member, the generated SQL for DuckDB would contain the filter value as VARCHAR. That would not be correct SQL for DuckDB, and it would not run.

For other dialects, Cube is able to cast numeric filter values to correct numeric types.

To Reproduce
Steps to reproduce the behavior:

  1. Use DuckDB, build a query with a filter on a numeric member
  2. Run it, it will fail
  3. Check the generated SQL, it will contain the filter value as VARCHAR
Error: Binder Error: Cannot compare values of type BIGINT and type VARCHAR - an explicit cast is required
...WHERE ("base_orders__count" >= ?)...

Expected behavior
Cube generates SQL where the filter value is cast to a proper numeric type.

Version:
v1.2.0

Additional context
Compare to SQ generated for BigQuery and Athena:

...WHERE ("base_orders__count" >= CAST(? AS FLOAT64))...
...WHERE ("base_orders__count" >= CAST(? AS DOUBLE))...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugLEGACY. Use the Bug issue type insteaddriver:duckdbhelp wantedCommunity contributions are welcome.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions