Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

insert_columns raises 'Cannot convert value to Java int' for a commit_every beyond 32 bits, which insert_many accepts #322

Closed

Description

@tae898

Level: bindings. Found by the 2026-10-14 re-hunt of the read and write transports (main 708061d, the wheel's engine jars, JDK 25).

Database.insert_columns(..., commit_every=n) passes int(n) to a Java int, so a commit_every of 2**31 or more raises ArcadeDBError: Failed to bulk-insert ...: Cannot convert value to Java int. insert_many takes any int, and a value beyond the row count is the natural way to ask for one transaction (sys.maxsize included). The call fails before it writes anything.

A second, smaller mismatch in the same area: the docstring of Database.lookup_by_key says it returns "Python-wrapped records" and its example does list(db.lookup_by_key(...)) and records[0], but the method returns the first match or None (the API page says Optional[Document]), and list(record) raises TypeError: 'Document' object is not iterable (out/p15-commit-every-main.txt, last line).

Repro (repros/repro-3-insert-columns-commit-every.py, saved output out/repro-3-insert-columns-commit-every.main.txt):

insert_many     commit_every=2147483647   inserted 5
insert_columns  commit_every=2147483647   inserted 5
insert_many     commit_every=2147483648   inserted 5
insert_columns  commit_every=2147483648   ArcadeDBError: Failed to bulk-insert into 'C': Cannot convert value to Java
insert_many     commit_every=10000000000  inserted 5
insert_columns  commit_every=10000000000  ArcadeDBError: Failed to bulk-insert into 'C': Cannot convert value to Java

The fix clamps the value at 2**31 - 1 before the call (the Java loop commits when a row index is a multiple of it, so a larger value means never within one call) and corrects the docstring. Test first, in the pull request.

Activity

  1. added a commit that references this issue on Oct 13, 2026
    e42eec1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions