Knows Not Much
Knows Not Much

Reputation: 31556

'ResultSet' object has no attribute 'column_types

I installed cassandra on my mac using

homebrew install cassandra

It installed cassandra version

[cqlsh 5.0.1 | Cassandra 3.10 | CQL spec 3.4.4 | Native protocol v4]

Now I connect to cassandra using cqlsh and create a keyspace and a table. when I try to query the table in cqlsh. I get an error

'ResultSet' object has no attribute 'column_types

I googled the error and found this

https://groups.google.com/forum/#!msg/nosql-databases/O3kZmk8AoeY/PooBo9uWDQAJ

https://issues.apache.org/jira/browse/CASSANDRA-12799

But it is not clear to me what exactly the solution was... the second link seems to suggest that the problem is automatically resolved... but for me it clearly isn't

Upvotes: 5

Views: 1253

Answers (4)

Tushar Agarwal
Tushar Agarwal

Reputation: 365

Try this: pip install cassandra-driver --upgrade

Upvotes: 0

Julien Duponchelle
Julien Duponchelle

Reputation: 595

I just submit a pull request with a fix to the homebrew project: https://github.com/Homebrew/homebrew-core/pull/10650

Upvotes: 2

10 cls
10 cls

Reputation: 1445

I had this problem on my work macOS laptop a few days ago; fixed as follows (from memory as not at work) :

  • pip uninstall cql, cqlsh, cassandra-driver, and anything else that looks related.
  • brew uninstall cassandra (your data will remain ok).
  • brew install python -- I believe this is the key step due to macOS python causing incompatibilities.
  • brew install cassandra (this may be sufficient to fix the problem, if not, continue).
  • sudo pip install cqlsh (I know, the sudo is not good - maybe you can swap this step with the preceding brew install cassandra to avoid using sudo).

That fixed the problem for me, but left me with incompatible protocol versions which I've temporarily resolved with cqlsh --cqlversion="#.#.#"

Upvotes: 0

Christian Gintenreiter
Christian Gintenreiter

Reputation: 168

I'm getting the same error after upgrading from 3.9 to 3.10 with brew. Unfortunately I was unable to find the reason nor the answer. What I researched was to install/uninstall other versions that were also installed via pip (cqlsh, cassandra-driver).

Looking for an alternative I installed cassandra via docker which hopefully is a viable alternative for you too - it works for me.

Using the guide from docker-cassandra - https://hub.docker.com/_/cassandra/ I setup and connected to cassandra 3.10 with the following two commands (assuming docker ist basically installed from DMG-file).

docker run --name cas310 -p 9042:9042 -d cassandra:3.10
docker exec -it cas310 cqlsh

This also lets you access cassandra via CQL from outside the container via default cql-port 9042.

Note: Connecting to the dockerized cassandra-instance using cqlsh from the cassandra-version i installed via brew on the host lead to the very same error message as well. So this makes me believe there's some problem with the python-driver packaged with cassandras brew-package.

Upvotes: 1

Related Questions