Giter Site home page Giter Site logo

Comments (6)

bkief avatar bkief commented on May 31, 2024

Would it be as simple as changing this line

DataType::Decimal {
scale: 0,
precision: p @ 0..=9,
}
| DataType::Numeric {
scale: 0,
precision: p @ 0..=9,
} => fetch_decimal_as_identical_with_precision::<Int32Type>(is_optional, p as i32),

to scale: p @ 0..=9,

from odbc2parquet.

pacman82 avatar pacman82 commented on May 31, 2024

Hello @bkief,

My Rust is well "rusty", but am I correct in understanding that all ODBC Decimal Types convert to FIXED_LEN_BYTE_ARRAY. I have a Oracle NUMBER(5,3) and I was surprised its physical_type was not int32

Yes, you are correct. All Decimals with a scale different from 0 are currently represented as FIXED_LEN_BYTE_ARRAY. The binary representation in there is a twos_complement and not what some might suspect, their text representation.

Would it be as simple as changing this line

No, because ODBC would not represent the DECIMAL as an integer. identical in that context means that the ODBC and Parquet representation of the type in question are identical and can be copied without any transformation. Yet the most reliable way to get decimals out of ODBC is to transfer them in their text representation. So some conversion must always happen, but for decimals with scale 0 which ODBC will happily convert into integers for me.

Cheers, Markus

from odbc2parquet.

pacman82 avatar pacman82 commented on May 31, 2024

Would it be better for you if the physical type were i32? If so, how?

from odbc2parquet.

bkief avatar bkief commented on May 31, 2024

I was hoping to use the delta_bitpacked encoding. I have time-series data that lends itself very well to that format.

from odbc2parquet.

pacman82 avatar pacman82 commented on May 31, 2024

Thanks, I know understand much better. Could you think of any reason why someone might not want to have the decimal backed by a Physical integer type?

from odbc2parquet.

pacman82 avatar pacman82 commented on May 31, 2024

Hello @bkief ,

odbc2parquet 0.10.0 is released. The behaviour changes in terms of physical types are as follows:

precision 0 to 9 (inclusive) => INT32
precision 10 to 18 (inclusive) => INT64
precision 18 to 38 (inclusive) => FIXED_LEN_BYTE_ARRAY

Cheers, Markus

from odbc2parquet.

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.