Query on partial Row Key

2015-06-05 Thread Vijay Kukkala
Cluster configuration: Phoenix 4.0.2 with Hbase 0.98 HDP 2.1 One of our table has a primary key (customerId int, timestamp BigInt, transactionId varchar). One of our use cases is to retrieve records by customerId and transactionID. select * from my_table where cid = ? and tid = ? looking at

Re: Query on partial Row Key

2015-06-05 Thread Hemal Parekh
Vijay, You can try this. select * from my_table where primary key like '?%' and tid = ? (argument ? is customerid) This will do a range scan and a filter on server side. Other option is to change primary key design to (customerId int, transactionId varchar, timestamp BigInt). This will allow

Re: Query on partial Row Key

2015-06-05 Thread James Taylor
Hi Vijay, You've got a couple of options: 1) Force the query to do a skip scan (the Phoenix equivalent of the FuzzyRowKeyFilter) by adding a hint like this: select /*+ SKIP_SCAN */ * from my_table where cid = ? and tid = ? By default, Phoenix won't do a skip scan when there's gaps in the pk

Re: Query on partial Row Key

2015-06-05 Thread Vijay Kukkala
Thanks James, I tried both and that helped. On Fri, Jun 5, 2015 at 9:44 AM James Taylor jamestay...@apache.org wrote: Hi Vijay, You've got a couple of options: 1) Force the query to do a skip scan (the Phoenix equivalent of the FuzzyRowKeyFilter) by adding a hint like this: select