ydb-platform / ydb-go-sdk

Pure Go native and database/sql driver for YDB
https://ydb.tech
Apache License 2.0
136 stars 71 forks source link

Wrong time.Duration to Interval conversion #241

Closed WhiteBars closed 2 years ago

WhiteBars commented 2 years ago

https://github.com/ydb-platform/ydb-go-sdk/blob/afc2b4337964777a4cae96c419cbf571d8281249/table/types/value.go#L63

There is problem with time conversion. In Golang time has nanoseconds accuracy while YDB Interval has microsecond accuracy. So time duration after conversion multiplying by 100 and time became incorrect

asmyasnikov commented 2 years ago

https://ydb.tech/en/docs/yql/reference/types/primitive#datetime

WhiteBars commented 2 years ago

There is a code represents the problem I found https://pastebin.com/7BN6j7Mx

10 microsecond not equal 10 microseconds.

asmyasnikov commented 2 years ago

fixed