RE: How to count table rows from Java?

2015-06-29 Thread Riesland, Zack
/JDBC? Thanks! From: James Taylor [mailto:jamestay...@apache.org] Sent: Friday, June 26, 2015 2:14 PM To: user@phoenix.apache.org Subject: Re: How to count table rows from Java? Zach, I wouldn't at all say that doing a count(*) is not recommended. It's important to know that 1) this requires

Re: How to count table rows from Java?

2015-06-29 Thread James Taylor
different query clients. But how do I set a high timeout so that I can do a large query via Java/JDBC? Thanks! From: James Taylor [mailto:jamestay...@apache.org] Sent: Friday, June 26, 2015 2:14 PM To: user@phoenix.apache.org Subject: Re: How to count table rows from Java? Zach, I wouldn't

RE: How to count table rows from Java?

2015-06-29 Thread Riesland, Zack
Perfect. Thank you so much! -Original Message- From: James Taylor [mailto:jamestay...@apache.org] Sent: Monday, June 29, 2015 11:51 AM To: user Subject: Re: How to count table rows from Java? Server side HBase properties such as hbase.rpc.timeout need to be set in your hbase-sites.xml

RE: How to count table rows from Java?

2015-06-29 Thread Riesland, Zack
, June 29, 2015 11:51 AM To: user Subject: Re: How to count table rows from Java? Server side HBase properties such as hbase.rpc.timeout need to be set in your hbase-sites.xml. There's no API to set these. The phoenix.query.timeoutMs can be set using http://docs.oracle.com/javase/7/docs/api/java/sql

How to count table rows from Java?

2015-06-26 Thread Riesland, Zack
I wrote a Java program that runs nightly and collects metrics about our hive tables. I would like to include HBase tables in this as well. Since select count(*) is slow and not recommended on Phoenix, what are my alternatives from Java? Is there a way to call

Re: How to count table rows from Java?

2015-06-26 Thread Nick Dimiduk
RowCounter is s mapreduce program. After the program completes execution of the job, it returns information about that job, including job counters. RowCounter includes its counts in the job counters, so they're easily accessed programmatically from the returned object. It's not a ResultSet, but it

Re: How to count table rows from Java?

2015-06-26 Thread James Taylor
Zach, I wouldn't at all say that doing a count(*) is not recommended. It's important to know that 1) this requires a full table scan and 2) this is done by Phoenix asynchronously. You'll need to set the timeouts high enough for this to complete. Phoenix will be much faster than running a MR job,