Skip to content Skip to sidebar Skip to footer

Python Int Too Large To Put In Sqlite

I am getting the error OverflowError: Python int too large to convert to SQLite INTEGER from the following code block. The file is about 25gb, so it must be read in parts. leng

Solution 1:

The Problem

I just encountered the same error message. It seems from what is said in this github issue that this is a problem of sqlite3 not handling unsigned 64-bit numbers.

Overflow Errors

By the way, an Overflow Error happens when you get out of the bounds of the number type.

Example

If you add 1 to the number 15, which is stored as a 4-bit integer you get 0, because 16 is 10000 in binary, but only the last four bits (0000) can be stored.

[1111] + [0001] = 1 [0000]

The Solution?

So the only kind of workaround I see, would be to store your integer as a string.

Post a Comment for "Python Int Too Large To Put In Sqlite"