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

clickhouse Auto Inference detect String column as Float #59476

Closed
shabir1 opened this issue Feb 1, 2024 · 3 comments · Fixed by #59500
Closed

clickhouse Auto Inference detect String column as Float #59476

shabir1 opened this issue Feb 1, 2024 · 3 comments · Fixed by #59500
Assignees

Comments

@shabir1
Copy link

shabir1 commented Feb 1, 2024

clickhouse Auto Inference detects the String column as Float
I have a String column, Values start with E like

col1
E76565
E76428
E76525
.
.

Clickhouse detects it as Nullable(Float) with all NULL values.

@shabir1
Copy link
Author

shabir1 commented Feb 1, 2024

if c1 column is detected as Float64 then why the value is NaN

CREATE TABLE test2 as format(CSV, 'E876,42.42,Hello World!')
select * from test2

Screenshot from 2024-02-01 18-48-14

@Avogar Avogar self-assigned this Feb 1, 2024
@Avogar
Copy link
Member

Avogar commented Feb 1, 2024

That's because e876 and similar is valid float in exponential notation:

:) select * from format(CSV, '1E20')

┌────────────────────c1─┐
│ 100000000000000000000 │
└───────────────────────┘

But I think we should infer such values as Strings anyway. I will fix it

@Avogar
Copy link
Member

Avogar commented Feb 1, 2024

As a workaround you can set a prefferred type for this specific column using setting schema_inference_hints

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

Successfully merging a pull request may close this issue.

2 participants