Taylor Finnell created PHOENIX-1441:
---------------------------------------

             Summary: BETWEEN clause not behaving as expected
                 Key: PHOENIX-1441
                 URL: https://issues.apache.org/jira/browse/PHOENIX-1441
             Project: Phoenix
          Issue Type: Bug
            Reporter: Taylor Finnell


Seeing some odd behaviors when using BETWEEN clauses.

I expect the following queries to all return the same row.

{code}
select * from "geography_staging_hbase" where rowkey BETWEEN 
'5303593079877290056|' AND 
'5303593079877290056|FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
|   ROWKEY   |    g_id    |    c_c     |    r_cd    |    city    |    dma     | 
   msa     |    a_cd    |    ltd      |
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
{code}

--

{code}
select * from "geography_staging_hbase" where "g_id" = '5303593079877290056';
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
|   ROWKEY   |    g_id    |    c_c     |    r_cd    |    city    |    dma     | 
   msa     |    a_cd    |    ltd      |
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
| 5303593079877290056|c7c150acfba8327800884a723413d420 | 5303593079877290056 | 
US         | NE         | CENTRALCITY  |
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
{code}

--

{code}
select * from "geography_staging_hbase" where rowkey BETWEEN 
'5303593079877290056|' AND 
'5303593079877290056|c7c150acfba8327800884a723413d420';
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
|   ROWKEY   |    g_id    |    c_c     |    r_cd    |    city    |    dma     | 
   msa     |    a_cd    |    ltd      |
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
| 5303593079877290056|c7c150acfba8327800884a723413d420 | 5303593079877290056 | 
US         | NE         | CENTRALCITY  |
+------------+------------+------------+------------+------------+------------+------------+------------+-------------+
{code}

The first query gives nothing back, I would have expected it to give back the 
same row as the other two.

If I modify the first query to

{code}
select * from "geography_staging_hbase" where rowkey between 
'5303593079877290056|' AND '5303593079877290056~';
{code}

It works, i assume because the '~' is a higher ascii value than '|'

But, I still think the first query should work, right?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to