Enhance PostgresType to support array types (serialization, not deserialization)#2017
Merged
robfrank merged 4 commits intoMar 4, 2025
Merged
Conversation
Contributor
Author
|
Not going to lie, only tested it on a long 1024 array of floats, didn't have the data to test with ints, bools etc |
ExtReMLapin
commented
Feb 27, 2025
| } | ||
| } else { | ||
| // Default to text array for empty lists | ||
| valueType = PostgresType.ARRAY_TEXT; |
Contributor
Author
There was a problem hiding this comment.
Maybe do something else, not sure
Collaborator
|
Can you give me an example on the data to store in the db? |
Contributor
Author
|
It's from the data from this thread : #2005 Python code : (Just install the package with import psycopg
import time
with psycopg.connect(user="root", password="rootroot",
host='localhost',
port='5432',
dbname='ORANO_DOC',
sslmode='disable'
) as connection:
connection.autocommit = True
_time = time.time()
with connection.cursor() as cursor:
cursor.execute("""MATCH {type: EMBEDDING, as: embb}-->{ as: target}
RETURN embb.vector, target.asRID()""")
results = cursor.fetchall()
print(results[0])
print('time', time.time()-_time) |
Contributor
Author
|
As for the data type I ran tests with ARRAY_OF_FLOATS |
2 tasks
Contributor
Author
Now covered by tests : #2039 |
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.
Fixes an issue that leaded the array to be returned to the client as a string because it was not implemented in the postgres types
Serialization is implemented, deserialization is NOT implemented.
First code wrote in java so i'm all ears open to fix things in this PR.
Fixed my NPM install so precommit is fixed aswell