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 Jain (JIRA)" <ji...@apache.org> on 2014/03/08 01:22:53 UTC

[jira] [Created] (PHOENIX-122) SELECT * FROM TABLE ORDER BY NONPK COLUMN doesn't return values for all the columns

Samarth Jain created PHOENIX-122:
------------------------------------

             Summary: SELECT * FROM TABLE ORDER BY NONPK COLUMN doesn't return values for all the columns
                 Key: PHOENIX-122
                 URL: https://issues.apache.org/jira/browse/PHOENIX-122
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 3.0.0
            Reporter: Samarth Jain


CREATE TABLE TEST 
(TEXT VARCHAR, 
INT INTEGER, 
DOUBLE DECIMAL,
CDATE DATE
CONSTRAINT PK PRIMARY KEY
(Text
)
)

UPSERT INTO TEST VALUES ('A', 1, 4.92, current_date())
UPSERT INTO TEST VALUES ('B', 2, 3.69,current_date())
UPSERT INTO TEST VALUES ('C', 3, 2.46,current_date())
UPSERT INTO TEST VALUES ('D', 4, 1.23,current_date())        

SELECT * FROM TEST

A	1	4.92	   2014-03-07
B	2	3.69	   2014-03-07
C	3	2.46	   2014-03-07
D	4	1.23    2014-03-07


SELECT * FROM TEST ORDER BY DOUBLE

TEXT	INT	 DOUBLE 	CDATE
D	      <null>  1.23	       <null>
C	      <null>	  2.46	       <null>
B	      <null>   3.69	       <null>
A	       <null>  4.92              <null>

As you can see, when ordering by a non-pk column, it only displays the PK column Text and the column in order by clause.


When doing an order by a PK column, it displays the records correctly.

select * from test order by TEXT

TEXT	INT	DOUBLE	CDATE
D	          4	1.23	       2014-03-07
C	          3	2.46	       2014-03-07
B	          2	3.69	       2014-03-07
A	          1	4.92        2014-03-07






--
This message was sent by Atlassian JIRA
(v6.2#6252)