phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "N Campbell (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-3626) predicate comparing a CHAR and VARCHAR does not work
Date Wed, 25 Jan 2017 01:44:26 GMT
N Campbell created PHOENIX-3626:
-----------------------------------

             Summary: predicate comparing a CHAR and VARCHAR does not work
                 Key: PHOENIX-3626
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3626
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.7.0
         Environment: Hortonworks 2.5.3
            Reporter: N Campbell


Using phoenix-4.7.0.2.5.3.0-37-client

Following query returns 1 row that projects BB and BB

select TVCHAR.CVCHAR , TCHAR.CCHAR from TVCHAR , TCHAR where  TVCHAR.RNUM = 3 and TCHAR.RNUM
= 3

change the query to either query returns no rows

select TVCHAR.CVCHAR , TCHAR.CCHAR from TVCHAR , TCHAR where  TVCHAR.RNUM = 3 and TCHAR.RNUM
= 3 and TVCHAR.CVCHAR  = TCHAR.CCHAR

select TVCHAR.CVCHAR , TCHAR.CCHAR from TVCHAR , TCHAR where  TVCHAR.RNUM = 3 and TCHAR.RNUM
= 3 and TVCHAR.CVCHAR <> TCHAR.CCHAR

create table  if not exists TCHAR ( RNUM integer  not null primary key , CCHAR char(32 ) 
  );

create table  if not exists TVCHAR ( RNUM integer  not null primary key , CVCHAR varchar(32
)    );

upsert into TCHAR(RNUM, CCHAR) values ( 0, NULL);
upsert into TCHAR(RNUM, CCHAR) values ( 1, '');
upsert into TCHAR(RNUM, CCHAR) values ( 2, ' ');
upsert into TCHAR(RNUM, CCHAR) values ( 3, 'BB');
upsert into TCHAR(RNUM, CCHAR) values ( 4, 'EE');
upsert into TCHAR(RNUM, CCHAR) values ( 5, 'FF');
upsert into TVCHAR(RNUM, CVCHAR) values ( 0, NULL);
upsert into TVCHAR(RNUM, CVCHAR) values ( 1, '');
upsert into TVCHAR(RNUM, CVCHAR) values ( 2, ' ');
upsert into TVCHAR(RNUM, CVCHAR) values ( 3, 'BB');
upsert into TVCHAR(RNUM, CVCHAR) values ( 4, 'EE');
upsert into TVCHAR(RNUM, CVCHAR) values ( 5, 'FF');




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

Mime
View raw message