Skip to content

DataFrame/Arrow ingest, to_polars(), PRODUCT quantization, vector SQL options, example 27 (#19) - #30

Merged
tae898 merged 4 commits into
mainfrom
port/ingest-vector
Oct 24, 2026
Merged

tae898 merged 4 commits into
mainfrom
port/ingest-vector

Conversation

@tae898

@tae898 tae898 commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Part of #19 (Features group, 2 of 2). Ported by hand from humemai/arcadedb-embedded-python: #390 (DataFrame and Arrow ingest, to_polars()), #384 (vector SQL options, IndexType.LSM_SPARSE_VECTOR), #446 and #395 (PRODUCT quantization), plus the later test change from humemai#407 to test_vector_sql.py and humemai#418's cleanup of dataframe.py. Formatted with black 26.10.1 and isort 9.0.2 --profile black, Bandit clean with the CI invocation from CLAUDE.md.

Depends on #27. The branch is based on port/runtime-fixes, so the diff shows only this PR. It touches the same core.py, and the examples tests assume the #27 heap and log defaults. GitHub retargets the PR to main once #27 merges. It is independent of #28 and of the functions PR (port/functions-events); both PRs add an entry to examples/README.md at the same spot, so whichever merges second needs a one-line rebase. About 1,300 of the 2,100 added lines are tests.

What is in it

  • Database.insert_dataframe() and Database.insert_arrow(): a pandas or Polars DataFrame, or an Arrow table, loaded straight into a document or vertex type in batches, with declared property types honoured and a float column refused before a row is written (new module dataframe.py; core.py).
  • ResultSet.to_polars() (results.py).
  • New polars extra in pyproject.toml (polars, pyarrow>=23.0.1, numpy), polars in the test extra, and polars in the two workflow install lines (test-python-bindings.yml, and test-python-examples.yml for example 27).
  • Vector SQL options: IndexType.LSM_SPARSE_VECTOR (schema.py, core.py) and the tests that pin the SQL options and the defaults (test_vector_sql.py).
  • PRODUCT quantization (quantization="PRODUCT") after fix(#10514): PRODUCT quantization searches with its PQ codes, writes a small graph file and honours pqTrainingLimit arcadedb#10545: the SQL path, find_nearest, the new index settings (vector.py, core.py). The test detects whether the engine has #10545 and asserts the matching behaviour either way.
  • Example 27_dataframe_arrow_ingest.py and its examples/README.md entry.
  • Tests: test_dataframe_ingest.py, test_vector_product_quantization.py, test_vector_sql.py.

Java glue and what the wheel must contain

None. The ingest goes through the ColumnBatcher and insert_columns that main already ships; main's ColumnBatcher.java and RowBatcher.java are newer than the source repo's copies, and I did not touch them. No build.sh, Dockerfile.build or jar change. The wheel's engine jar decides whether the PRODUCT tests exercise the new or the old behaviour.

Tests run

Python and Java sources of this branch overlaid on an unpacked linux/amd64 wheel (engine 26.11.1-SNAPSHOT, bridge jar recompiled from src/java), Python 3.12, with pandas, pyarrow and polars installed.

Files Result
test_dataframe_ingest, test_vector_product_quantization, test_vector_sql, test_resultset_arrow, test_columnar_readers, test_numpy_support, test_schema, test_importer_api, test_core 283 passed, 0 skipped

Example 27 also ran to completion against the overlay. CI of this PR has not been looked at yet when this was written.

Not included

  • Documentation pages (docs/api/*, docs/guide/vectors.md, docs/guide/import.md, the example page): they go to the Antora component (docs: Antora component arcadedb-python with the first slice of pages #23), not here.
  • On macOS the examples workflow still installs numpy<2.0, as in main. humemai dropped that cap together with pyarrow for example 27 (the Intel macOS leg there is disabled); I left the cap alone because I cannot tell from here whether that leg is on here. If the macOS examples leg fails on pyarrow, that is the cause.

🤖 Generated with Claude Code

… SQL options (#19)

Ported from humemai/arcadedb-embedded-python:
- #390: Database.insert_dataframe() / insert_arrow(), ResultSet.to_polars(), the polars extra, example 27
- #384 (+ #407 test changes): vector SQL options tests, IndexType.LSM_SPARSE_VECTOR
- #446 and #395: PRODUCT quantization (SQL path, find_nearest, new index settings)

Needs no new Java: the ingest goes through the existing ColumnBatcher.
Based on port/runtime-fixes (#27).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow on Apple Silicon)

The cap was for Intel Macs, whose leg (darwin/amd64) is disabled. pyarrow 26
requires NumPy 2, so example 27 failed on darwin/arm64 with 'pyarrow requires
NumPy 2.0 or newer, found 1.26.4'. Same change as humemai/arcadedb-embedded-python#390.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The only conflict was examples/README.md: this branch adds the entry for example
27 and main (through runtime-fixes) the entry for example 29 at the same spot.
Kept both, in numeric order.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 changed the base branch from port/runtime-fixes to main October 24, 2026 20:15
@tae898
tae898 merged commit 4aca6bb into main Oct 24, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant