Comments (6)
Hello @joneechua
Please provide all details
from clickhouse-go.
Hello @joneechua
Please provide all details
i read the clickhouse result by the go code above,get the unexpected result
2024/05/28 17:17:18 1 time.Time DateTime64(8, 'Asia/Shanghai') 1677-09-21 08:18:27.29044838 -> -9223372036
but i read this record from clickhouse client
:) select * from t2 where id=1;
SELECT *
FROM t2
WHERE id = 1
Query id: e2a696c9-5911-4061-ba0d-ca63d561457c
Connecting to database test at ***as user root.
Connected to ClickHouse server version 23.8.9.
ClickHouse server version is older than ClickHouse client. It may indicate that the server is out of date and can be upgraded.
┌─id─┬───────────────────────────dt─┐
1. │ 1 │ 2262-04-12 07:47:18.00000000 │
└────┴──────────────────────────────┘
1 row in set. Elapsed: 0.002 sec.
from clickhouse-go.
Hello @joneechua
Please provide all detailsi read the clickhouse result by the go code above,get the unexpected result
2024/05/28 17:17:18 1 time.Time DateTime64(8, 'Asia/Shanghai') 1677-09-21 08:18:27.29044838 -> -9223372036
but i read this record from clickhouse client
:) select * from t2 where id=1; SELECT * FROM t2 WHERE id = 1 Query id: e2a696c9-5911-4061-ba0d-ca63d561457c Connecting to database test at ***:3395 as user root. Connected to ClickHouse server version 23.8.9. ClickHouse server version is older than ClickHouse client. It may indicate that the server is out of date and can be upgraded. ┌─id─┬───────────────────────────dt─┐ 1. │ 1 │ 2262-04-12 07:47:18.00000000 │ └────┴──────────────────────────────┘ 1 row in set. Elapsed: 0.002 sec.
how can i get the correct string result by go driver? thx.
from clickhouse-go.
@joneechua please have a look into a "Details" section of issue content. Please provide a driver version and other missing values. Thank you.
from clickhouse-go.
@joneechua please have a look into a "Details" section of issue content. Please provide a driver version and other missing values. Thank you.
sorry about that, I've revised this section.
from clickhouse-go.
The max value for any DateTime64 precision is hardcoded as (UTC timezone):
https://github.com/ClickHouse/clickhouse-go/blob/v2.26.0/lib/column/datetime64.go#L37
maxDateTime64, _ = time.Parse("2006-01-02 15:04:05", "2262-04-11 23:47:16")
However, this should be the case only for DateTime64(9)
; the max value for DateTime64 with less precision should be 2299-12-31 23:59:59
; see the docs:
Supported range of values: [1900-01-01 00:00:00, 2299-12-31 23:59:59.99999999]
Note: The precision of the maximum value is 8. If the maximum precision of 9 digits (nanoseconds) is used, the maximum supported value is 2262-04-11 23:47:16 in UTC.
Currently, if you specify a time.Date
object that is later than 2262-04-11 23:47:16
but earlier than 2299-12-31 23:59:59
, even if your field is DateTime64(0), there will be a rollover to 1900-01-01 00:00:00
(could it be an int overflow on the driver side?).
from clickhouse-go.
Related Issues (20)
- Memory leak from INSERT? HOT 1
- Go programming language: Connecting to clickhouse is a major pain HOT 5
- How to use it in version 1.18 of go HOT 1
- How to set ODBC Driver HOT 1
- Differences between the sql.DB.Prepare and sql.DB.Exec methods in parsing a map[string]interface{} argument HOT 1
- PrepareBatch fails when insert into has no space before parentheses
- PrepareBatch fail when a table name such as `db`.`t` HOT 4
- ProfileInfo not availble when using Batch.Send() HOT 1
- Query parameter not working for LIMIT and OFFSET HOT 3
- When deactivating a clickhouse cluster node, it is not possible to automatically connect to the normal node HOT 1
- Add Example for Using `WithReleaseConnection` in Go ClickHouse Client HOT 1
- PrepareBatch for tablename with special characters in name, stop works after upgrade from 2.23.2 to 2.26.0 HOT 2
- When should I call Close on connection? HOT 4
- Batch insert into columns of type Array(Array..)) fails for interfaced slices
- AsyncInsert does not bind named parameters in insert queries HOT 2
- v2.25.0 breaks sql.Scanner implementation HOT 2
- v2.27.0 breaks compatibility with OrderedMap for inserts HOT 2
- Unable to determine server timezone
- Support to 9440 connections on Clickhouse Cloud using usql HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-go.