I am using Cassandra python driver. Version details :
[cassandra-driver (3.25.0)] [cqlsh 6.8.0 | Cassandra 4.0.4 | CQL spec 3.4.5 | Native protocol v4]
I am querying Cassandra database where I have created few columns which have empty space and special characters such as '%' I manage to do by supplying those columns in double quotes( ex "Mem Util %")
CREATE TABLE my_keyspace.memutils ( time text PRIMARY KEY, "Mem Util %" text, ...
When I query those column via CQL, I supply the column name with double quotes and I get proper data as well as my result columns are as it is, example :
select "Mem Util %" from my_keyspace.memutils; Mem Util % ---------------------- 9.177055477 83.85167852
But when I use Cassandra-python driver, the query is able to get the proper data but it replaces spaces in the column's name with underscore in the result data(ResponseFeature)
from cassandra.cluster import Cluster from cassandra.policies import DCAwareRoundRobinPolicy from cassandra.auth import PlainTextAuthProvider ... print("Select query--> ", fetch_query) response_future = self.session.execute(fetch_query); ... print('response_future --> ', response_future)
Select query--> select Time, "Mem Util %" from my_keyspace.memutils; response_future--> Row(time='631', Mem_Util='9.177055477')
The result data set also doesn't' have "%" in the column.
Question : Is there any option in session.execute(), to disable above behavior ? I referred doc