You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth (JIRA)" <ji...@apache.org> on 2014/02/24 23:22:19 UTC

[jira] [Created] (PHOENIX-73) Row value constructor doesn't work correctly for a table that has Column in DESC order in row key

Samarth created PHOENIX-73:
------------------------------

             Summary: Row value constructor doesn't work correctly for a table that has Column in DESC order in row key
                 Key: PHOENIX-73
                 URL: https://issues.apache.org/jira/browse/PHOENIX-73
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 2.2.3, 3.0.0
            Reporter: Samarth
            Assignee: James Taylor


Steps to reproduce:

STEP 1
CREATE TABLE T (
COL1 CHAR(3), 
COL2 DATE, 
COL3 CHAR(3),
COL4 INTEGER CONSTRAINT PK PRIMARY KEY (COL1, COL2 DESC, COL3)
)

Step 2:
UPSERT INTO T (COL1, COL2, COL3) VALUES ('abc', to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S'), 'def');
UPSERT INTO T (COL1, COL2, COL3) VALUES ('123', to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S'), '456');

Step3:
SELECT * FROM T WHERE COL1 = 'abc' AND COL2 = to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S') AND COL3 = 'def'
 
- returns the expected row. 

Similarly,

SELECT * FROM T WHERE COL1 = '123' AND COL2 = to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S') AND COL3 = '456'

returns the expected row. 

However, the below query doesn't return any rows. It should returned the above two rows.

SELECT * FROM T WHERE (COL1, COL2, COL3) IN (('abc', to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S'), 'def'), ('123', to_date('2014-02-24 20:49:39.959', 'yyyy-MM-dd HH:mm:ss.S'), '456'))


If one removes DESC from the row key in CREATE TABLE statement, all the above 3 queries then return the expected rows. 





--
This message was sent by Atlassian JIRA
(v6.1.5#6160)