我使用python驱动程序来获取一些时间序列数据。我想把数据放在一个numpy数组中。在
所以问题是把我得到的pagedResult转换成numpy数组。
目前我只做for row in result: out.append(row.price)
。这是非常缓慢的,因为分页。我试着用statement = SimpleStatement(select_query, fetch_size=10**6)
但是我得到了
cassandra.ReadTimeout: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'data_retrieved': False, 'required_responses': 1, 'consistency': 1}```
我如何快速阅读大约10^7行,并将它们放入numpy中?在
如果数据在多个分区中,则应异步查询不同的分区。在
如果知道一些界限,就可以从不同的副本一次查询分区的多个切片。在
请参阅文档中的下一页,了解如何通过并行使用异步查询来最大限度地提高python驱动程序的性能:
https://github.com/datastax/python-driver/blob/master/docs/performance.rst
相关问题 更多 >
编程相关推荐