ClickHouse / ClickHouse/clickhouse-odbc

Floats get rounded if handled as String

Open
#382 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
285
Forks
105
Avg merge
3h 56m
Merged PRs (30d)
3

Description

Currently have a setup, where I connect to an Oracle DB via Clickhouse ODBC and I just came across a very strange issue. Not sure yet if this is a bug or feature.

If I query the Oracle DB via ODBC, I usually set up the tables where all columns are set as string, due to the fact that Oracle has like 1824728 data types and I simply do not care about them yet. Then I realized that the numbers were odd, to be more precise, they were correctly rounded from a real number to an integer number.

When I set the data type to `Float32`, the value gets represented correctly

```
| | | |
| Original Oracle DB | Clickhouse | Clickhouse |
|-----------------------|---------------|---------------|
Data Type | Number | String | Float32 |
Value | 32.86 | 33 | 32.86 |
---------------------------------------------------------
^
| This should not be 33
```

Is that a bug or a feature? Any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.