GitHub user paleolimbot added a comment to the discussion: Querying PostgreSQL 
generate_subscripts from Python with a dimension from bound parameters

> The context is that I'm making a SQLAlchemy Dialect for PostgreSQL/ADBC

Awesome!

> How can I get ADBC to assume that it's just an INT?

I think in this case it's coming from pyarrow, which picks int64 as its default 
inference of an arbitrary Python integer:

https://github.com/apache/arrow-adbc/blob/5721207931003695162bbe246991144313f40c48/python/adbc_driver_manager/adbc_driver_manager/dbapi.py#L707

It's a great point that the default conversion to BIGINT is likely to cause 
some problems. I forget from when I was working on this whether libpq gives us 
the opportunity to query the parameter types that *it* thinks we should be 
using from an arbitrary query (it looks like it isn't implemented from our 
side, anyway):

https://github.com/apache/arrow-adbc/blob/5721207931003695162bbe246991144313f40c48/c/driver/postgresql/statement.cc#L763-L766

GitHub link: 
https://github.com/apache/arrow-adbc/discussions/2865#discussioncomment-13275239

----
This is an automatically sent email for user@arrow.apache.org.
To unsubscribe, please send an email to: user-unsubscr...@arrow.apache.org

Reply via email to