FAQ
Hi,

     Hive has an option to execute queries without entering into hive shell.
Like, hive -e "select * from user".
I need to know whether hbase has similar option to execute scan, count, put
and get queries without entering into hbase shell.

Recently, I came across a command for count as:

$ $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename> [<column1> <column2>...]

This command is somewhat similar to my requirement. But it displays the count output as:
14/04/30 11:35:11 INFO mapred.JobClient: Running job: job_201404300925_0005
14/04/30 11:35:12 INFO mapred.JobClient: map 0% reduce 0%
14/04/30 11:35:21 INFO mapred.JobClient: map 100% reduce 0%
14/04/30 11:35:21 INFO mapred.JobClient: Job complete: job_201404300925_0005
14/04/30 11:35:21 INFO mapred.JobClient: Counters: 17
14/04/30 11:35:21 INFO mapred.JobClient: Job Counters
14/04/30 11:35:21 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=5742
14/04/30 11:35:21 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0
14/04/30 11:35:21 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0
14/04/30 11:35:21 INFO mapred.JobClient: Launched map tasks=1
14/04/30 11:35:21 INFO mapred.JobClient: Data-local map tasks=1
14/04/30 11:35:21 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0
14/04/30 11:35:21 INFO mapred.JobClient: org.apache.hadoop.hbase.mapreduce.RowCounter$RowCounterMapper$Counters
14/04/30 11:35:21 INFO mapred.JobClient: ROWS=2
14/04/30 11:35:21 INFO mapred.JobClient: FileSystemCounters
14/04/30 11:35:21 INFO mapred.JobClient: HDFS_BYTES_READ=64
14/04/30 11:35:21 INFO mapred.JobClient: FILE_BYTES_WRITTEN=72445
14/04/30 11:35:21 INFO mapred.JobClient: Map-Reduce Framework
14/04/30 11:35:21 INFO mapred.JobClient: Map input records=2
14/04/30 11:35:21 INFO mapred.JobClient: Physical memory (bytes) snapshot=103153664
14/04/30 11:35:21 INFO mapred.JobClient: Spilled Records=0
14/04/30 11:35:21 INFO mapred.JobClient: CPU time spent (ms)=530
14/04/30 11:35:21 INFO mapred.JobClient: Total committed heap usage (bytes)=60489728
14/04/30 11:35:21 INFO mapred.JobClient: Virtual memory (bytes) snapshot=517734400
14/04/30 11:35:21 INFO mapred.JobClient: Map output records=0
14/04/30 11:35:21 INFO mapred.JobClient: SPLIT_RAW_BYTES=64


But i need the command to produce just the number of rows for count. Like, if I enter:
$ $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter user

The result should be like just 2(number of rows) because i need to store this value as a variable in java.

Can anyone help?

To unsubscribe from this group and stop receiving emails from it, send an email to scm-users+unsubscribe@cloudera.org.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupscm-users @
categorieshadoop
postedApr 30, '14 at 6:24a
activeApr 30, '14 at 6:24a
posts1
users1
websitecloudera.com
irc#hadoop

1 user in discussion

Rajeshn: 1 post

People

Translate

site design / logo © 2022 Grokbase