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

Regression in LowCardinality(Nullable(String)) type processing in v4.0.5 #805

Closed
btmc opened this issue Apr 19, 2024 · 2 comments · Fixed by #814
Closed

Regression in LowCardinality(Nullable(String)) type processing in v4.0.5 #805

btmc opened this issue Apr 19, 2024 · 2 comments · Fixed by #814
Assignees

Comments

@btmc
Copy link

btmc commented Apr 19, 2024

What happened:

Trying to select a column of aforementioned type returns an error:

sql: Scan error on column index 0, name "%column_name%": unsupported Scan, storing driver.Value type *string into type *string: Could not process SQL results

It seems to be a regression of #785, wherein the regexp for "Nullable(String)" Converter has been changed to match on the beginning of string only, thus not matching LowCardinality(Nullable(String)) anymore (and in this case default Converter is used and that is probably the cause of the error).

I've downgraded datasource version to v4.0.4 to corroborate that and the error indeed disappeared.


What you expected to happen:

No errors.


How to reproduce it (as minimally and precisely as possible):

In Explore view:

select
    toNullable('test')
;

OK

select
    toLowCardinality('test')
;

OK

select
    toLowCardinality(
        toNullable('test'))
;

Error:

sql: Scan error on column index 0, name "toLowCardinality(toNullable('test'))": unsupported Scan, storing driver.Value type *string into type *string: Could not process SQL results

Environment:

v4.0.6, grafana v10.4.1

@btmc btmc added datasource/ClickHouse type/bug Something isn't working labels Apr 19, 2024
@btmc btmc changed the title Regression in LowCardinality(Nullable(String)) type processing in **v4.0.5** Regression in LowCardinality(Nullable(String)) type processing in v4.0.5 Apr 19, 2024
@adamyeats
Copy link
Contributor

@SpencerTorres As you were involved in the PR that @btmc linked to above, would you be able to comment on this? As they rightly point out, ^ matches the start of string, meaning that nesting within LowCardinality() would indeed break after this PR was merged.

@SpencerTorres
Copy link
Collaborator

Good find. This is a case I failed to identify when I reviewed the first PR, although I was suspicious. We can add some unit tests for this and maybe a different set of regexs for LowCardinality().

Downgrading to v4.0.4 is the correct workaround for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants