我在 table.scan 方法中使用 row_prefix 来过滤行。问题是该函数在使用字符串文字时起作用。但是,如果使用变量,则不会返回任何数据。
例如,以下代码正在工作
connection = happybase.Connection(connect string)
table = connection.table('table')
table = table.scan(row_prefix='abc001', include_timestamp=False)
但是下面的代码没有返回任何数据
connection = happybase.Connection(connect string)
table = connection.table('table')
query = '\'{0}{1}\''.format(args['str1'], args['str2'])
table = table.scan(row_prefix=query, include_timestamp=False)
第二种情况没有错误。