Repository navigation
Add functionality to detect big integers - #2139
Conversation
|
I will review, soon. |
|
One issue is that when a big integer is a root number, the current simdjson implementation creates a copy of a buffer, and therefore could truncate the value of a big integer. It is an unlikely event, but nevertheless, maybe it's possible to get rid of buffer copying for numbers? |
Pull requests are invited. |
|
This looks quite good to me. Let me run a few additional checks. |
|
Ok. This is solid. Merging. I will do some extra work after merging (additional tests and docs). |
This is a real issue but I will check in a workaround before releasing this. |
@lemire, are you planning to include this workaround in the next release? |
|
@saleyn The workaround has been included. There should not be problem currently. If you think that there is a bug, consider raising it as a new issue. |
|
Hi, reopenning it Currently still having the issue in python https://pypi.org/project/pysimdjson/ simdjson.Parser().parse(json.dumps({"q": 111111111111111111111111})))Not sure if this should be fixed using 7.0.2 |
|
@SCcagg5 I think you are reporting the issue in the wrong repo. The code that you are presenting looks like Python code. |
|
@lemire That's the repo pinned on the package page sry |
|
@SCcagg5 I think you are using @TkTech's excellent wrapper at https://github.com/TkTech/pysimdjson In simdjson per se (which is a C++ library), we reject E.g., compilers would issue the following error: It is possible, in simdjson, to provide your own way to handle such large numbers, but given that there is no standard way to represent a number like If you need to start big integers, the standard approach is to embed them into a string. If you just mean the floating-point value, then it is typically gets serialized as 1.1111111111111111e+23. I refer you to the JSON specification (https://www.rfc-editor.org/rfc/rfc8259) which discusses JSON portability. |
|
This issue here is resolved. Any discussion regarding pysimdjson should be taken to https://github.com/TkTech/pysimdjson |
This extention adds the ability to identify big integers in JSON input. A big integer is a number not fitting in the 64-bit space.
Typical use case: