我正在尝试使用 python 在我的 aws 键空间表中检索列的最大值。我把它作为类中的一种方法
query = SimpleStatement('select min (timestamp) from ' + keyspace + '.'+ table_name) #+ ' limit 2'
read = self.session.execute(query)
return read.current_rows
那是我的读取功能,我称之为:
access.read_latest_timestamp('gdapp_finance','policy_test')
.
我收到以下错误。有人可以帮助我吗?
InvalidRequest Traceback (most recent call last)
/tmp/ipykernel_223/2808458841.py in <module>
----> 1 access.read_latest_timestamp('gdapp_finance','policy_test')
/tmp/ipykernel_223/1193162473.py in read_latest_timestamp(self, keyspace, table_name)
58 query = SimpleStatement('select min (timestamp) from ' + keyspace + '.'+ table_name , \
59 consistency_level=ConsistencyLevel.ONE) #+ ' limit 2'
---> 60 read = self.session.execute(query)
61
62 return read.current_rows
~/.local/lib/python3.9/site-packages/cassandra/cluster.cpython-39-x86_64-linux-gnu.so in cassandra.cluster.Session.execute()
~/.local/lib/python3.9/site-packages/cassandra/cluster.cpython-39-x86_64-linux-gnu.so in cassandra.cluster.ResponseFuture.result()
InvalidRequest: Error from server: code=2200 [Invalid query] message="min is not yet supported." ```