-
-
Notifications
You must be signed in to change notification settings - Fork 68
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance PostgresType to support array types (serialization, not deserialization) #2017
Enhance PostgresType to support array types (serialization, not deserialization) #2017
Conversation
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 |
} | ||
} else { | ||
// Default to text array for empty lists | ||
valueType = PostgresType.ARRAY_TEXT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do something else, not sure
Can you give me an example on the data to store in the db? |
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) |
As for the data type I ran tests with ARRAY_OF_FLOATS |
Now covered by tests : #2039 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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