Closed RealTehreal closed 6 months ago
After diving through pimdb's code, I have to admit, that it's not optimal for use with MariaDB. I had to change some things to make it work. I'll see if it's possible to make the changes in a way, that other DBMS are not affected, and in this case, create a pull request.
@RealTehreal Took me a while to take a look at this. The culprit seems to be the following limit:
Column length too big for column 'directors' (max = 21844); use BLOB or TEXT instead
One way to fix this would be to increase the limits in database.py
, especially the one for the directors
field.
(
ImdbDataset.TITLE_CREW,
[
Column("tconst", String(_TCONST_LENGTH), nullable=False, primary_key=True),
Column("directors", String((_NCONST_LENGTH + 1) * _CREW_COUNT - 1)), # <-- FIXME: Increase _NCONST_LENGTH
Column("writers", String((_NCONST_LENGTH + 1) * _CREW_COUNT - 1)),
],
),
But this might just move the error to another field.
SQLAlchemy does provide a Text type that in practice has no limit or a very high one. Replacing all the String(<SOME_LIMIT>)
with simply Text()
should solve this for good. Though in my experience some databases still have an implicit limit of about 4000 or 32000 characters.
Feel free to try this out with Text
and if it work submit a pull request.
I already tried to increase the limits, and just as mentioned, the issue moved from field to field. After hours of trial and error, I finally gave up on it.
Greets
@RealTehreal Did you try replacing the String(...)
with Text()
too?
@RealTehreal Did you try replacing the
String(...)
withText()
too?
I cannot tell anymore.
@RealTehreal Did you try replacing the
String(...)
withText()
too?I cannot tell anymore.
Alright, thanks. I guess I just change it to Text
, test it with the databases that are easily accessible to me and then hope for the best concerning MariaDB.
The char
fields are now of type text
, so there length is only limited by physical limits of the database.
Hey folks,
I tried to transfer the IMDB TSV files to a fresh MariaDB database and ran into the following error. Any help with resolving the error is very appreciated. Thank you very much in advance.
$ pimdb transfer --database "mariadb://root@localhost/imdb?unix_socket=/opt/lampp/var/mysql/mysql.sock" all
Output:
The link at the end brings me nowhere. I took a look at pimdb's source code as well, but I couldn't find where those "26623"-values are defined.
Kind regards