GithubHelp home page GithubHelp logo

Comments (3)

killwort avatar killwort commented on August 29, 2024

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.

rsibanez89 avatar rsibanez89 commented on August 29, 2024

@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;

image


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.

killwort avatar killwort commented on August 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.