目前,我们在 ubuntu 14.04 上使用 Cassandra Python 驱动程序 3.0.0,当检索的行包含大 map 时,我们遇到了“IndexError: Buffer slice out ofbounds”异常。
>>> query = 'SELECT "user_id", "data" FROM users WHERE user_id IN (bb47d269-73a6-475a-9283-0002e2a0872a, 81258ffd-fbb0-47e6-8a5e-0003208880ba)'
>>> future = store.session.execute_async(query)
>>> future.result() <- exception generated here
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cassandra/cluster.py", line 3122, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:59993)
IndexError: Buffer slice out of bounds
数据为 map ,包含约3000条条目。
最佳答案
这看起来与此处已打开的问题非常相似。
https://datastax-oss.atlassian.net/browse/PYTHON-459
该修复尚未在主要版本中发布,但应该会在 3.1 中发布。同时,您可以通过使用 --no-cython 标志安装驱动程序来解决此问题。您可能会看到性能略有下降,但它应该可以解决您的问题。
如果您使用 pip 安装,在安装时禁用 cython 的可靠方法是运行。
“CASS_DRIVER_NO_CYTHON=1 pip 安装 casandra 驱动程序”
请确保在重新安装之前卸载。
关于python - Cassandra Python驱动程序3.0.0 "IndexError: Buffer slice out of bounds"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34780527/