Apache phoenix problem with order by and offset giving duplicate results in paging

2019-11-10 Thread Lalit Jadhav
Hello,

I'm using order by with offset for paging in apache phoenix. I am getting a
duplicate result on the next page.

I have a view of the HBase table in Apache phoenix. I am using TO_NUMBER()
to convert my stringified column into an integer. I want to sort this
converted column in descending order.

Example: I have an Hbase view like :

 --
| TITLE  |   COUNT  |
  --
| t8 | 10   |
  --
| t9 | 2|
| t4 | 1|
| t6 | 1|
| t10| 1|
| t7 | 1|
| t43| 0|
| t14| 0|
| t11| 0|
| t42| 0|

My Query:

Select TITLE,COUNT from Hbase_view order by TO_NUMBER(COUNT) desc limit 5
offset 0;

Result :

++--+
| TITLE  |   COUNT  |
++--+
| t8 | 10   |
| t9 | 2|
| t4 | 1|
| t7 | 1|
| t10| 1|

Next Query:

Select TITLE,COUNT from Hbase_view order by TO_NUMBER(COUNT) desc limit 5
offset 5;

result :

++--+
| TITLE  |COUNT |
++--+
| t7 | 1|
| t43| 0|
| t14| 0|
| t11| 0|
| t42| 0|
++--+

Here t7 is repeated on both the result.

Expected result :

1st Query:-
++--+
| TITLE  |COUNT |
++--+
| t8 | 10   |
| t9 | 2|
| t4 | 1|
| t6 | 1|
| t10| 1|

2nd Query

> ++--+
> | TITLE  |COUNT |
> ++--+
> | t7 | 1|
> | t43| 0|
> | t14| 0|
> | t11| 0|
> | t42| 0|
> ++--+


Please help me to know what is the exact issue? Also, I want to know, is
CURSOR can be used for the same purpose?.


---
Lalit Jadhav


Searching a string in Phoenix view in all columns

2018-08-15 Thread Lalit Jadhav
I have a phoenix view of HBase table with n number of columns. I want to
search a string consider "Foo". But it can be in any columns. (Need to scan
all columns)  Let me know what query I can fire to retrieve the desired
outcome.
For Example:

SELECT * FROM DemoTable
WHERE Any Column LIKE 'Something%'

Note: Column names are not known.


-- 
Regards,
*Lalit Jadhav,*
*Database Group Lead.*
*Everything happens to everybody sooner or later if there is time enough*