Skip to content
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

CQL error in base_table.py line 327 #160

Open
I22Scode opened this issue May 14, 2024 · 2 comments
Open

CQL error in base_table.py line 327 #160

I22Scode opened this issue May 14, 2024 · 2 comments

Comments

@I22Scode
Copy link

Hi I could not get a vector store created in Cassandra (running locally in docker) The keyspace exists and I have other tables in the Cassandra cluster.

The exception repored is
cassandra.protocol.SyntaxException: <Error from server: code=2000 [Syntax error in CQL query] message="line 1:110 mismatched input '<' expecting ')' (..., body_blob TEXT, vector VECTOR[<]...)">

The stack trace is:

File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\langchain_community\vectorstores\cassandra.py", line 121, in init
self.table = MetadataVectorCassandraTable(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\mixins.py", line 720, in init
super().init(*pargs, **new_kwargs)
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\mixins.py", line 195, in init
super().init(*pargs, **kwargs)
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\mixins.py", line 490, in init
super().init(*pargs, **kwargs)
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\base_table.py", line 44, in init
self.db_setup()
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\mixins.py", line 246, in db_setup
super().db_setup()
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\mixins.py", line 498, in db_setup
super().db_setup()
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\base_table.py", line 289, in db_setup
self.execute_cql(create_table_cql, op_type=CQLOpType.SCHEMA)
File "C:\Users\Jerome\Code\ML-studies.venv\Lib\site-packages\cassio\table\base_table.py", line 327, in execute_cql
return cast(Iterable[RowType], self.session.execute(statement, args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The CQL statement has VECTOR<str as part of the column definition and it looks to be a wrong syntax.

Thank you

@I22Scode I22Scode changed the title CQL error in base_table.py line CQL error in base_table.py line 327 May 14, 2024
@liamka
Copy link

liamka commented Jun 29, 2024

already solve this? @I22Scode

@hemidactylus
Copy link
Collaborator

Hello @I22Scode could you please check your Cassandra version? The VECTOR<float, N> syntax comes with Cassandra 5, perhaps this is the issue?

CassIO's CI runs against the "cassandra:5" Docker image, and as part of the CI integration testing statements such as the CREATE TABLE that is making your database angry are run several times.

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

No branches or pull requests

3 participants