Code Monkey home page Code Monkey logo

Comments (14)

raipc avatar raipc commented on June 26, 2024

@rodionos
Please, try the following query:

SELECT tags.symbol, tags.class_code, CAST(tags.lot AS integer) FROM atsd_entity WHERE tags.symbol = 'LKOH' limit 1

Without CAST, AS assigns a column alias

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

Indeed, my mistake. Related issue, with getString returning the value with fractions:

CAST(tags.lot AS INTEGER) AS lot

rs.getString(3) - returns 1.0

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024
SELECT datetime, trade_num, price, quantity, side FROM atsd_trade
getString(1) returns truncated time
2021-04-08 07:00:03

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

Is there a way to get precise trade datetime, including microseconds?

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

Indeed, my mistake. Related issue, with getString returning the value with fractions:

CAST(tags.lot AS INTEGER) AS lot

rs.getString(3) - returns 1.0

I will fix it in ATSD by returning correct datatype in metadata. Now double is returned in any case.

BTW, shouldn't we support all known numeric datatypes in CAST expression? Currently only number, integer, float are supported.

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

Is there a way to get precise trade datetime, including microseconds?

Could you try with latest version 1.4.9, please? It should be available in Maven

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

Only 1.4.8 is available on mavencentral:

<dependency>
    <groupId>com.axibase</groupId>
    <artifactId>atsd-jdbc</artifactId>
    <version>1.4.8</version>
</dependency>

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

https://mvnrepository.com/artifact/com.axibase/atsd-jdbc - here only 1.4.8 is listed

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

https://mvnrepository.com/artifact/com.axibase/atsd-jdbc - here only 1.4.8 is listed

Index is not updated yet, but the jar should be available
https://search.maven.org/artifact/com.axibase/atsd-jdbc/1.4.9/jar

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

datetime works ok with the 1.4.9 downloaded from Releases, although I would return time column with fractions as well.

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

datetime works ok with the 1.4.9 downloaded from Releases, although I would return time column with fractions as well.

Same, should be working without driver upgrade when correct metadata is returned

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

@rodionos Could you try with latest snapshot on latest ATSD, please?

from atsd-jdbc.

raipc avatar raipc commented on June 26, 2024

Version number increase required because ATSD may send general number type as metadata. JDBC driver didn't recognized it and used varchar fallback. Since 1.4.10, number is alias for decimal in JDBC driver

from atsd-jdbc.

rodionos avatar rodionos commented on June 26, 2024

I don't see this error on the 1.4.9 version, closing.

from atsd-jdbc.

Related Issues (16)

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.