[ 
https://issues.apache.org/jira/browse/PHOENIX-3052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Liew updated PHOENIX-3052:
--------------------------------
    Description: 
{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 * from testchar1 INNER JOIN testchar2 ON testchar1.pk = testchar2.pk
{code}

`testchar1` and `testchar2` contain the same data so two rows should be 
returned.

Note that the following query works when testchar3.pk has the same column 
length as testchar1.pk:
{code}
select * from testchar1 INNER JOIN testchar3 ON testchar1.pk = testchar3.pk
{code}


  was:
{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 * from testchar1 INNER JOIN testchar2 ON testchar1.pk = testchar2.pk
{code}

`testchar1` and `testchar2` contain the same data so two rows should be 
returned.

Note that the following query works:
{code}
select * from testchar1 INNER JOIN testchar3 ON testchar1.pk = testchar3.pk
{code}
when testchar3.pk has the same column length as testchar1.pk


> Cannot JOIN on comparing CHAR columns of differing length
> ---------------------------------------------------------
>
>                 Key: PHOENIX-3052
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3052
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Kevin Liew
>            Priority: Minor
>              Labels: char, join, sql
>
> {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 * from testchar1 INNER JOIN testchar2 ON testchar1.pk = testchar2.pk
> {code}
> `testchar1` and `testchar2` contain the same data so two rows should be 
> returned.
> Note that the following query works when testchar3.pk has the same column 
> length as testchar1.pk:
> {code}
> select * from testchar1 INNER JOIN testchar3 ON testchar1.pk = testchar3.pk
> {code}



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

Reply via email to