eyevz commented on issue #3485:
URL: https://github.com/apache/arrow-adbc/issues/3485#issuecomment-3580157807
Here is a very simple reproduction.
Environment:
- python 3.12.6
- pyarrow 22.0.0
- adbc-driver-manager 1.9.0
- adbc-driver-postgresql 1.9.0
The code
```python
from decimal import Decimal
import pyarrow as pa
from adbc_driver_postgresql import dbapi
URI = "postgresql://postgres:password@localhost/postgres"
table = pa.Table.from_arrays(
[[Decimal("0.01"), Decimal("0.20"), Decimal("3.00")]],
schema=pa.schema([("bar", pa.decimal128(38, 9))])
)
print(table)
print("===")
with dbapi.connect(URI) as conn:
with conn.cursor() as cur:
cur.execute("create table if not exists foo (bar numeric)")
cur.adbc_ingest("foo", table, mode="append")
cur.execute("select * from foo")
data = cur.fetchall()
cur.execute("drop table if exists foo")
print(data)
```
produces output
```
pyarrow.Table
bar: decimal128(38, 9)
----
bar: [[0.010000000,0.200000000,3.000000000]]
===
[('0.10',), ('2.0',), ('30',)]
```
As you can see, values have been scaled by a factor of ten.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]