首页 新闻 会员 周边 捐助

hbase thrift C#怎么根据前缀查询特定key的数据

0
悬赏园豆:10 [已关闭问题] 关闭于 2016-08-08 15:46

比如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

北在北方的主页 北在北方 | 初学一级 | 园豆:180
提问于:2016-08-01 11:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册