比如key有dog1,dog2,dog3分别对应3行数据,根据dog查询所有以dog开头的key的行数据,怎么写?
hbase是0.98.6,thfrit是0.9或0.7,
下面是我写的代码,没成功,不知道是代码错误还是其他问题:
#region 前缀查询
TScan scan = new TScan();
scan.FilterString = Encoding.UTF8.GetBytes("983b45411c6b062d");
int scanner = client.scannerOpenWithScan(Encoding.UTF8.GetBytes("TW20160720"), scan, null);
List<TRowResult> scanResult = client.scannerGet(scanner);
foreach (var key in result)
{
Console.WriteLine("RowKey:\n{0}", Encoding.UTF8.GetString(key.Row));
foreach (var k in key.Columns)
{
Console.WriteLine("Family:cf:\n" + Encoding.UTF8.GetString(k.Key));
Console.WriteLine("Value:" + Encoding.UTF8.GetString(k.Value.Value));
}
}
#endregion