python - Python - Cassandra - Assigning a value to a variable from the result set
问题描述
I am trying to assign the result value for a max value query to a variable in python. I have tried getString(), getInt(), getBigInt() functions but ending up with errors like:
AttributeError: 'com.datastax.driver.core.ArrayBackedRow' object has no attribute 'getBigNum'
Here is my function:
def select_max_of_sequece_number():
query = "select max(text_next_seq_number) as max_seq_num from
employee_table;"
print query
print ' '
ResultSet = dbquery(query) #db Query function which will execute the query and returns result
for result in ResultSet:
row = json.loads(result.getBigNum("max_seq_num"))
print type(row)
Getting the below error: AttributeError: 'com.datastax.driver.core.ArrayBackedRow' object has no attribute 'getBigNum'
解决方案
推荐阅读
- node.js - 如何在 $near mongoose 中使用聚合?
- java - 数组是类型是什么意思?
- python - 有一个与笔记本文件同名的python文件是否合理?
- javascript - Chrome 扩展 - 读取网络请求正文内容
- python-3.x - 列出以逗号分隔的字符串值
- c - 在保持比率的同时减少一对整数的最佳方法
- spacy - 使用 SpaCy 的自定义 NER 训练模型无法训练
- javascript - 结合2组JSON
- javascript - 在 JavaScript 中声明包含子对象的新变量是否有任何性能优势?
- java - MarkLogic Java API 异常抛出方法