Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't handle resultset with 128 bit int #141

Open
gijzelaerr opened this issue Jun 4, 2021 · 4 comments
Open

Can't handle resultset with 128 bit int #141

gijzelaerr opened this issue Jun 4, 2021 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@gijzelaerr
Copy link
Collaborator

keyerror_bug.zip

@gijzelaerr gijzelaerr added the bug Something isn't working label Jun 4, 2021
@ghost
Copy link

ghost commented Jun 9, 2021

The solution is to consider mapping hge to Numpy object array

@gijzelaerr gijzelaerr added this to the 0.11 milestone Jun 9, 2021
@gijzelaerr
Copy link
Collaborator Author

adding a 128 bit column definition to our cffi layer:

 typedef struct { monetdbe_types type; __int128 *data; size_t count; char *name; __int128 null_value; double scale; int (*is_null)(__int128 *value); } monetdbe_column_int128_t;

is not supported by cffi:

cffi.FFIError: Unsupported type: '__int128'.  Please look at http://cffi.readthedocs.io/en/latest/cdef.html#ffi-cdef-limitations and file an issue if you think this type should really be supported.

https://foss.heptapod.net/pypy/cffi/-/issues/457

@gijzelaerr gijzelaerr modified the milestones: 0.11, 0.12 Dec 20, 2021
@gijzelaerr gijzelaerr modified the milestones: 0.12, 0.11 Dec 29, 2021
@aris-koning
Copy link
Contributor

Is it not possible to cast the array of int128 returned by monetdbe as a numpy structured array? In that case the array in memory is still properly aligned and in theory could directly be cased into an array of 128 bits integers if needed. E.g. if there is native implementation available on the user side to directly handle 128 bits. Otherwise the user can always access the individual high and low part of the huge integer through the structured array interface of numpy.

@gijzelaerr
Copy link
Collaborator Author

one of the issues is that cffi doesn't support int128 directly yet, so we first need to work around that to even get access to values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants