【发布时间】:2020-12-17 08:41:41
【问题描述】:
我想检索与大于给定value 的最小rowkey 对应的行。
如何在 Python 中实现 Golang 客户端中存在的prefixSuccessor 功能?
【问题讨论】:
标签: python google-cloud-platform bigtable
我想检索与大于给定value 的最小rowkey 对应的行。
如何在 Python 中实现 Golang 客户端中存在的prefixSuccessor 功能?
【问题讨论】:
标签: python google-cloud-platform bigtable
这就是你要找的吗?您需要先调整和测试此代码。
def prefixSuccessor(text, num):
# sort the text list
text.sort(reverse=True)
output = ""
# loop through the list
for i in range(num):
output += text[i]
return output
if __name__ == "__main__":
# list of words
text = ["ahty", "ghf", "hfy", "hfgt"]
# find the length
num = len(text)
# print output
print(prefixSuccessor(text, num))
【讨论】: