質問

Explanation with an example:

import cql
cql connect to CF/Keyspace
last_key = XYZ (say it's getting fetched from else where)
cursor.execute(select * from domain_dimension where key=:key", key="last_key")

The CQL documentation says it can be done, but on console it says execute() got unexpected keyword argument.

Does Cassandra CQL really support query substitution?

役に立ちましたか?

解決

It looks like you need to pass the substitutions in a dict as a single arg, not as keyword args.

cursor.execute("select * from domain_dimension where key=:key", {'key': last_key})

That is how it specified in the example on the project homepage: http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top