Comments (3)
It is impossible.
Check clickhouse docs:
https://clickhouse.com/docs/en/sql-reference/data-types/date32
That type does not store TZ offset information, only number of seconds since unix epoch. No cast on C# side would get that info back.
from clickhouse-net.
@killwort Sure you are right, Clickhouse Date32
doesn't support offset.
But I'm talking about Clickhouse DateTime
.
Check this simple query:
SELECT toDateTime(now(), 'Australia/Sydney') AS column, toTypeName(column) AS column_type;
I just need to get back the offset, and I think if I read as string
with row.GetString(i)
I should be able to read it.
from clickhouse-net.
DateTime does not contain TZ info too. Actually, column type contains it DateTime('Australia/Sydney') however it is not contained in the values. Thus, all values in the column have same TZ and you actually supplied that TZ in your SQL. That's not driver's responsibility to parse and convert TZ offset, moreover, TZs in clickhouse are represented in 'unix style' strings and .net doesn't know anything about these values and cannot convert them to correct TZ offset.
Although it might seem easy to retain full TZ info while reading response (see ColumnType.cs, line 116) yet from the client code you'll never be able to read it in any reasonable way as ADO completely hides that 'complexity'.
from clickhouse-net.
Related Issues (20)
- Can't select more than 8 fields from clickhouse due to Tuple. HOT 1
- DB::NetException HOT 1
- SubstituteParameters doesn't check if the parameter name is not inside the quotes HOT 2
- Does syntaxis exists to cast data types? HOT 5
- Unable to cast object of type 'System.DBNull' to type 'System.String' HOT 2
- Does @bulk insert use pagination over IEnumerable? HOT 1
- Can't use bulk insert when object have least one property is null HOT 2
- Support for Bool type? HOT 1
- Any Way To optimize the ClickHouseCommand memory Use HOT 1
- how to set timezone in current connect HOT 3
- Driver hangs when inserting into ReplicatedMergeTree tables HOT 6
- Connection string for cluster db
- Inserting multiple rows doesn't work returns an timeout error HOT 4
- Please add a English and Russian headings in documentation / readme.md HOT 1
- Replace sql parameter error when execute sql HOT 1
- DataTable.Load(DbDataReader) has a wrong hadppend Can't use it in this way? HOT 3
- Пул подключений к БД HOT 1
- System.NotSupportedException:“Unknown column type Decimal(9, 4)” HOT 3
- find a bug ,when process nullable(DateTime) fields
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-net.