Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add vector_concat() and vector_slice() functions#2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dhairyadev26 wants to merge2 commits intotursodatabase:main
base:main
Choose a base branch
Loading
fromdhairyadev26:add-vector-concat-and-slice

Conversation

@dhairyadev26
Copy link

Description

This PR implements two new vector functions to maintain compatibility with Turso:

  1. vector_concat(X, Y) - Concatenates two vectors of the same type
  2. vector_slice(X, start_idx, end_idx) - Extracts a subvector from start_idx (inclusive) to end_idx (exclusive)

These functions were already available in Turso but were missing in libSQL, as noted in issue#2136.

Implementation Details

  • Added vector_func_impl.c with implementations of both functions
  • Included this file in libsql-sqlite3/src/vector.c
  • Created comprehensive tests in test_vector_functions.sql
  • Added documentation in README-vector-functions.md

Supported Vector Types

Both functions support all vector types except:

  • FLOAT1BIT for vector_slice (bit-by-bit extraction is more complex)

Testing

The implementation has been tested with the provided SQL test file that covers:

  • Basic functionality for both functions
  • Different vector types (FLOAT32, FLOAT64)
  • Edge cases (out of bounds indices, negative indices, etc.)

Fixes#2136

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add vector_concat() and vector_slice() functions

1 participant

@dhairyadev26

[8]ページ先頭

©2009-2025 Movatter.jp