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

Exceptions received while readind Decimal values from DB #50

Closed
Iourii opened this issue Jan 28, 2019 · 1 comment
Closed

Exceptions received while readind Decimal values from DB #50

Iourii opened this issue Jan 28, 2019 · 1 comment

Comments

@Iourii
Copy link

Iourii commented Jan 28, 2019

Description

I have a few decimal(x,y) fields in my DB and if I try to read data I'll receive an exception "Unknown column type"

Steps to reproduce

CREATE TABLE default.logger (
timestamp UInt64,
id UInt64,
value Decimal(19, 9)
) ENGINE = MergeTree()
ORDER BY
id SETTINGS index_granularity = 8192

And I'm trying to read data from this table for a test by simple "Select * FROM tableName" command.

Workarounds

Don't know for now

What should be done

Decimals should be added to Types or method public static ColumnType Create(string name) should be customized.

killwort pushed a commit that referenced this issue Jan 29, 2019
@killwort
Copy link
Owner

Decimal column type is rather new for clickhouse.
I've implemented it in 1.1.15, you could grab this version from nuget to test.
Column data range is limited to 10^28 - this is .NET platform limitation. If you wish you could improve my code with BigDecimal support to extend range to clickhouse's Decimal128 10^38 although yandex docs states that Decimal128 is a big performance hit. (See DecimalColumnType.Read and .ctor)
Another limitation is precision loss upon inserts, e.g. I'm inserting value 666 with precision 10 and get 668.6100869842. (See DecimalColumnType.Write)

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

No branches or pull requests

2 participants