【发布时间】:2016-09-21 23:11:17
【问题描述】:
这个查询很好,但如果我更改取回数据的时间量,我会收到以下错误(超过 200,000 行)。我不确定问题是查询还是填充/重新采样操作。我的集群中只有一台机器。
rsltES = session.execute( """SELECT * FROM tickdata.timeseries
WHERE
curve = 0
AND symbol = 1000
AND time > '2016-05-23T08:00:00-0400'
AND time < '2016-05-25T19:00:00-0400'
order by time
allow filtering;""")
dfes = dfes.set_index(['time'])
dfes.index.tz_localize('US/Eastern')
df_ohlcES = dfes.resample('5Min').ohlc()
df_ohlcES = df_ohlcES.ffill()
df_ohlcES['DateTime'] = np.arange(len(df_ohlcES))
# Move the DateTime Column to the Front
colsES = df_ohlcES.columns
colsES = colsES[-1:] | colsES[:-1]
df_ohlcES = df_ohlcES[colsES]
如果查询返回的数据过多,则查询超时。有没有办法增加超时时间?
Traceback (most recent call last):
File "pandascas.py", line 36, in <module>
allow filtering;""")
File "cassandra/cluster.py", line 1647, in cassandra.cluster.Session.execute (cassandra/cluster.c:28041)
File "cassandra/cluster.py", line 3243, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:61954)
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, 'required_responses': 1, 'consistency': 'LOCAL_ONE'}
【问题讨论】:
标签: python pandas datastax cassandra-2.0