You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/07/05 19:50:25 UTC

[GitHub] [arrow-adbc] paleolimbot opened a new issue, #871: c/driver/postgresql: Numeric type support

paleolimbot opened a new issue, #871:
URL: https://github.com/apache/arrow-adbc/issues/871

   The PostgreSQL driver currently doesn't support the "numeric"/"decimal" type. The numeric/decimal type is problematic because its precision/scale is specified item-wise rather than column-wise (i.e., there is no exact
   
   The binary recv function is here:
   
   https://github.com/postgres/postgres/blob/4f4d73466d71976b58f29121bab9d9fef6f3436e/src/backend/utils/adt/numeric.c#L1068-L1146
   
   The COPY data appears to be an an int16 (number of digits), an int16 ("weight"), an int16 ("sign", indicating positive, negative, NAN, positive inf, or negative inf), an int16 ("dscale") and then `uint8[number of digits]`. Digits values must be between 0 and 9.
   
   I took an initial stab at implementing before realizing how hard it would be: https://github.com/apache/arrow-adbc/compare/main...paleolimbot:arrow-adbc:postgres-numeric . It seems the natural way to represent this would be an Arrow Decimal128 or Decimal256 but that might require some integer math that would be hard to implement and doesn't allow for NaN, Inf, or -Inf. It could also be returned as a string?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-adbc] paleolimbot commented on issue #871: c/driver/postgresql: Numeric type support

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #871:
URL: https://github.com/apache/arrow-adbc/issues/871#issuecomment-1622760390

   Ah, sorry...I missed that!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-adbc] lidavidm commented on issue #871: c/driver/postgresql: Numeric type support

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #871:
URL: https://github.com/apache/arrow-adbc/issues/871#issuecomment-1622406952

   I had some thoughts in #767 already


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-adbc] paleolimbot closed issue #871: c/driver/postgresql: Numeric type support

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot closed issue #871: c/driver/postgresql: Numeric type support
URL: https://github.com/apache/arrow-adbc/issues/871


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org