hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Get addColumn + ColumnRangeFilter
Date Thu, 15 Jan 2015 09:58:35 GMT
Can you write a unit test which shows this behavior?

Thanks



> On Jan 14, 2015, at 9:09 PM, Taeyun Kim <taeyun.kim.innowireless@gmail.com> wrote:
> 
> Hi,
> 
> 
> 
> I have a situation that both Get.addColumn() and Get.setFilter(new
> ColumnRangeFilter(…)) needed to Get.
> 
> The source code snippet is as follows:
> 
> 
> 
>        Get g = new Get(getRowKey(lfileId));
> 
>        g.addColumn(Schema.ColumnFamilyNameBytes, MetaColumnNameBytes);
> 
>        g.setFilter(new ColumnRangeFilter(Bytes.toBytes(name), false,
> 
>            Bytes.toBytes(name + "~"), false));
> 
>        Result r = table.get(g);
> 
> 
> 
>        if (r.isEmpty())
> 
>            throw new FileNotFoundException(
> 
>                String.format("%d:%d:%s", projectId, lfileId, name));
> 
> 
> 
> When g.addColumn() is commented out, the Result is not empty, while with
> g.addColumn the Result is empty(FileNotFoundException is thrown).
> 
> Is it illegal to use both methods?
> 
> 
> 
> BTW, ther version of HBase used is 0.98. (Hortonworks HDP 2.1)
> 
> 
> 
> Thanks.

Mime
View raw message