hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Result different between remote Client and HBase Shell
Date Sat, 11 Dec 2010 00:41:33 GMT
   final String startingRow = (affiliate + SPACE_CHARACTER + m_startDate +
STARTING_INDEX + STARTING_INDEX);
What's the reason for including starting index twice ?

On Fri, Dec 10, 2010 at 4:31 PM, Peter Haidinyak <phaidinyak@local.com>wrote:

> Hi all,
>  I've run across an interesting problem. I have imported a few thousand
> rows into HBase and when I do a 'scan' from the shell tool I get back a
> different amount of rows than if I do the same query with a remote Java
> Client.
>
> scan tool command...
>
> hbase(main):030:0> scan 'TrafficLog', {STARTROW=>'pg_nhp1 2010-12-08
> 0000000', ENDROW=>'pg_nhp1 2010-12-10 9999999', COLUMNS=>['Data:BotCode'],
> VERSIONS=>1}
>
> This query returns 399 rows
>
> Java client code...
>
>    Scan scan = new Scan();
>    scan.setCaching(10000);
>    scan.setMaxVersions(1);
>    scan.setCaching(1000);
>    scan.addFamily(TRAFFIC_FAMILY_BYTES);
>
>    scan.addColumn(TRAFFIC_FAMILY_BYTES,
> TrafficFilterArray.BOT_CODE.getColumnAsBytes());
>
>    final String affiliate = m_affiliateList.get(0);
>    final String startingRow = (affiliate + SPACE_CHARACTER + m_startDate +
> STARTING_INDEX + STARTING_INDEX);
>    scan.setStartRow(startingRow.getBytes());
>
>    final String endingRow = (affiliate + SPACE_CHARACTER + m_endDate +
> ENDING_INDEX);
>    scan.setStopRow(endingRow.getBytes());
>    try
>    {
>      final ResultScanner scanner = m_trafficTable.getScanner(scan);
>      int rowCount = 0;
>      for (final Result result : scanner)
>      {
>        rowCount++;
>      }
>      m_logger.error("<><><> RowCount: " + rowCount);
>    }
>    catch (IOException p_ioException)
>    {
>      m_logger.error("IOException during scan.", p_ioException);
>    }
>
> This query returns 195 results.
>
> I'm at  a loss on this one.
>
> Thanks
>
> -Pete
>
> PS If there is a better way to query from the Client I would love to know
> it. I just hacked this together.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message