【问题标题】:Bigtable python Client: How do I retrieve the smallest rowkey that is greater than a given valueBigtable python客户端:如何检索大于给定值的最小行键
【发布时间】:2020-12-17 08:41:41
【问题描述】:

我想检索与大于给定value 的最小rowkey 对应的行。

如何在 Python 中实现 Golang 客户端中存在的prefixSuccessor 功能?

【问题讨论】:

    标签: python google-cloud-platform bigtable


    【解决方案1】:

    这就是你要找的吗?您需要先调整和测试此代码。

    
    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))
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-15
      • 2019-06-28
      • 2018-03-26
      • 1970-01-01
      相关资源
      最近更新 更多