hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars George <lars.geo...@gmail.com>
Subject Re: Stargate: ScannerModel
Date Mon, 23 May 2011 14:14:35 GMT
Ah, I see, only the column family is handed in, the column qualifier is ignored!

For example, I am setting this:

    Scan scan = new Scan();
    scan.setStartRow(Bytes.toBytes("row-10"));
    scan.setStopRow(Bytes.toBytes("row-15"));
    scan.addColumn(Bytes.toBytes("colfam1"), Bytes.toBytes("col-5"));
    ResultScanner scanner = table.getScanner(scan);

and in the debugging I see this being created as the payload when
getting the scanner handle:

startRow: "row-10"
endRow: "row-15"
columns: "colfam1"

No wonder I see all columns of that family. It is missing to add the
qualifier. So the place to change is in fromScan():

    byte[][] families = scan.getFamilies();
    if (families != null) {
      for (byte[] column: families) {
        model.addColumn(column);
      }
    }


Created HBASE-3912 and attached patch.

Lars


On Mon, May 23, 2011 at 3:00 PM, Lars George <lars.george@gmail.com> wrote:
> Hi,
>
> I just write a demo for the RemoteHTable and noticed the
> Scan.addColumn(family, qualifier) not being used. In the ScannerModel
> it does this:
>
>    byte[][] families = scan.getFamilies();
>    if (families != null) {
>      for (byte[] column: families) {
>        model.addColumn(column);
>      }
>    }
>
> where addColumn expects
>
>  /**
>   * Add a column to the column set
>   * @param column the column name, as &lt;column&gt;(:&lt;qualifier&gt;)?
>   */
>  public void addColumn(byte[] column) {
>    columns.add(column);
>  }
>
> The code inserts just the column qualifier though, not both. And even
> so, why is it not omitting everything then, but includes it all?
>
> Lars
>

Mime
View raw message