Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field filter functionality is broken for Date columns with Null values #243

Closed
Tony-metabase opened this issue Jun 6, 2024 · 0 comments · Fixed by #244
Closed

Field filter functionality is broken for Date columns with Null values #243

Tony-metabase opened this issue Jun 6, 2024 · 0 comments · Fixed by #244
Labels
bug Something isn't working

Comments

@Tony-metabase
Copy link

Describe the bug

If you have a date column with null filters you are not able to use field filters. This is happening with the latest driver 1.5.0

Steps to reproduce

Just create a table with one column of type date or datetime and add data including some null values.

image

Then just try to apply a field filter and it breaks

image

Expected behaviour

I want to be able to use field filters on date columns that havenull values

Error log

Code: 349. DB::Exception: Cannot convert NULL value to non-Nullable type: while executing 'FUNCTION CAST(updated_at : 0, 'date' :: 1) -> CAST(updated_at, 'date') Date : 4': While executing MergeTreeSelect(pool: PrefetchedReadPool, algorithm: Thread). (CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN) (version 24.2.2.16288 (official build)) , server ClickHouseNode [uri=https://jkwor7vhzu.eu-central-1.aws.clickhouse.cloud:8443/default, options={databaseTerm=schema,use_server_time_zone_for_dates=true,use_no_proxy=false,remember_last_set_roles=true,http_connection_provider=HTTP_URL_CONNECTION,product_name=metabase/1.5.0,select_sequential_consistency=true,sslmode=STRICT}]@-580620226

ClickHouse server

CREATE TABLE default.test_dates
(
    id              UInt64,
    updated_at      Nullable(DateTime),
    updated_at_date Nullable(Date)
)
    ENGINE = MergeTree
        ORDER BY id;

INSERT INTO test_dates (id) Values (1);
@Tony-metabase Tony-metabase added the bug Something isn't working label Jun 6, 2024
@slvrtrn slvrtrn mentioned this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant