Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D6D41747B for ; Wed, 23 Sep 2015 18:13:48 +0000 (UTC) Received: (qmail 36895 invoked by uid 500); 23 Sep 2015 18:13:45 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 36801 invoked by uid 500); 23 Sep 2015 18:13:45 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 36231 invoked by uid 99); 23 Sep 2015 18:13:44 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 18:13:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 78BA7184958 for ; Wed, 23 Sep 2015 18:13:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Ya24BiwuYbHa for ; Wed, 23 Sep 2015 18:13:39 +0000 (UTC) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 4882E20864 for ; Wed, 23 Sep 2015 18:13:39 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so250923884wic.1 for ; Wed, 23 Sep 2015 11:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=il5QFXGmW0UfKNCv0168pBoB0potxaJxW9CLDjsu9kk=; b=BylEHHz+zptw7pNUiTvViJ7BTeR5iLpBjsql9cL3TjruIN+hqug1REY8XXZL+0YlWP HpzSLaEV28gptK5aKyU+wznMG6YnRdgthxuU9K9gL7aGp9F5QaXQO30oy56QZpp3S6Er ITtjV5A0NkGr5CrUKsw9cqQVqHa009peZzlibFAXZxrDwq/pHEK8w/UeTysUDvpdrDnX eK1XL1tuiFNSQQYzOy3AYU4IGeQlCp6LdgsbwmNDY/Zm5znsUPNmGw9yKWUOrasRKsL2 0G36YVcGYxu9arByHdPCZ2cBiqO8rIEXm8RzRNQCPJ9/j7lLcIea9XR2yyzs8s+mW2DM ljCw== MIME-Version: 1.0 X-Received: by 10.194.80.38 with SMTP id o6mr37304342wjx.52.1443032011799; Wed, 23 Sep 2015 11:13:31 -0700 (PDT) Received: by 10.27.79.210 with HTTP; Wed, 23 Sep 2015 11:13:31 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Sep 2015 11:13:31 -0700 Message-ID: Subject: Re: Large number of column qualifiers From: Vladimir Rodionov To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7bb04db076830005206e12b1 --047d7bb04db076830005206e12b1 Content-Type: text/plain; charset=UTF-8 Check KeyValue class (Cell's implementation). getQualifierArray() returns kv's backing array. There is no SHORT limit on a size of this array, but there are other limits in HBase - maximum KV size, for example, which is configurable, but, by default, is 1MB. Having 50K qualifiers is a bad idea. Consider redesigning your data model and use rowkey instead. -Vlad On Wed, Sep 23, 2015 at 10:24 AM, Ted Yu wrote: > Please take a look at HBASE-11544 which is in hbase 1.1 > > Cheers > > On Wed, Sep 23, 2015 at 10:18 AM, Gaurav Agarwal wrote: > > > Hi All, > > > > I have Column Family with very large number of column qualifiers (> > > 50,000). Each column qualifier is 8 bytes long. The problem is the when I > > do a scan operation to fetch some rows, the client side Cell object does > > not have enough space allocated in it to hold all the columnQaulifiers > for > > a given row and hence I cannot read all the columns back for a given row. > > > > Please see the code snippet that I am using: > > > > final ResultScanner rs = htable.getScanner(scan); > > for (Result row = rs.next(); row != null; row = rs.next()) { > > final Cell[] cells = row.rawCells(); > > if (cells != null) { > > for (final Cell cell : cells) { > > final long c = Bytes.toLong( > > *cell.getQualifierArray()*, > cell.getQualifierOffset(), > > cell.getQualifierLength()); > > final long v = Bytes.toLong(cell.getValueArray(), > > cell.getValueOffset()); > > points.put(c, v); > > } > > } > > } > > > > The cell.getQualifierArray() method says that it's 'Max length is > > Short.MAX_VALUE which is 32,767 bytes.'. Hence it can only hold around > > 4,000 columnQualfiers. > > > > Is there an alternate API that I should be using or am I missing some > > setting here? Note that in worst case I need to read all the > > columnQualifiers in a row and I may or may not know a subset to fetch in > > advance. > > > > Even if this is not possible in a single call, is there a way to cursor > > through the columnQualifiers? > > > > I am presently using Hbase 0.96 client but can switch to Hbase 1.x if > there > > is an API in the newer version. > > > > --cheers, gaurav > > > > -- > > --cheers, gaurav > > > --047d7bb04db076830005206e12b1--