You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Kevin Liew (JIRA)" <ji...@apache.org> on 2016/07/06 18:58:11 UTC

[jira] [Created] (PHOENIX-3051) IN predicate cannot compare CHAR columns of differing length

Kevin Liew created PHOENIX-3051:
-----------------------------------

             Summary: IN predicate cannot compare CHAR columns of differing length
                 Key: PHOENIX-3051
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3051
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.7.0
            Reporter: Kevin Liew
            Priority: Minor


{code}
create table testchar1 (pk char(10) primary key)
create table testchar2 (pk char(20) primary key)

upsert into testchar1 values('a')
upsert into testchar2 values('a')

upsert into testchar1 values('b')
upsert into testchar2 values('b')

select testchar1.pk from testchar1 where testchar1.pk not in (select testchar2.pk from testchar2)
{code}

`testchar1` and `testchar2` contain the same data so the result of the select query should return an empty result set. Instead, all of the rows of `testchar1` are returned.

Note that the following queries will return an empty result set as expected:
{code}
select testchar1.pk from testchar1 where testchar1.pk not in ('a', 'b')
select testchar1.pk from testchar1 where testchar1.pk not in ('a  ', 'b  ')
{code}



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