Repository navigation
DataFrame/Arrow ingest, to_polars(), PRODUCT quantization, vector SQL options, example 27 (#19) - #30
Merged
Merged
Conversation
… 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>
8 of 10 tasks
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 totest_vector_sql.pyand humemai#418's cleanup ofdataframe.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 samecore.py, and the examples tests assume the #27 heap and log defaults. GitHub retargets the PR tomainonce #27 merges. It is independent of #28 and of the functions PR (port/functions-events); both PRs add an entry toexamples/README.mdat 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()andDatabase.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 moduledataframe.py;core.py).ResultSet.to_polars()(results.py).polarsextra inpyproject.toml(polars,pyarrow>=23.0.1,numpy),polarsin thetestextra, andpolarsin the two workflow install lines (test-python-bindings.yml, andtest-python-examples.ymlfor example 27).IndexType.LSM_SPARSE_VECTOR(schema.py,core.py) and the tests that pin the SQL options and the defaults (test_vector_sql.py).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.27_dataframe_arrow_ingest.pyand itsexamples/README.mdentry.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
ColumnBatcherandinsert_columnsthatmainalready ships;main'sColumnBatcher.javaandRowBatcher.javaare newer than the source repo's copies, and I did not touch them. Nobuild.sh,Dockerfile.buildor 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.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
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.numpy<2.0, as inmain. 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