hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Listas Discussões <lis...@arianpasquali.com>
Subject Re: Is it possible to scan the whole table without specify column classifier?
Date Thu, 09 Feb 2012 11:35:05 GMT
I've just realized how to do it
there is no need to specify column at the scan.

here is the code

Scan s = new Scan();

 HTable table = new HTable(conf,tableName);
ResultScanner scanner= table.getScanner(s);

// Scanners return Result instances.
// Now, for the actual iteration. One way is to use a while loop like so:
for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
// print out the row we found and the columns we were looking for
System.out.println("Found row: " + rr);
result.add(rr);
}

// The other approach is to use a foreach loop. Scanners are iterable!
// for (Result rr : scanner) {
//   System.out.println("Found row: " + rr);
// }

scanner.close();


tks
arian

2012/2/9 Listas Discussões <listas@arianpasquali.com>

> I have a table with classifiers not defined correctly.
> I would like to scan all of them and after that reorganize the schema.
>
> So the question is
> - Is it possible to scan the whole table without specify column classifier?
> and if it is not, there is some how to read all the table classifiers?
>
> tks
>
>
>


-- 
Arian Pasquali
FEUP researcher
twitter: @arianpasquali
www.arianpasquali.com

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