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 2017/02/16 20:25:41 UTC

[jira] [Updated] (PHOENIX-3683) Backward compatibility fails for joins

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

Samarth Jain updated PHOENIX-3683:
----------------------------------
    Attachment: PHOENIX-3683.patch

Thanks for finding this and providing the exact repro steps, [~mujtabachohan]. Attached patch should fix the issue.

> Backward compatibility fails for joins
> --------------------------------------
>
>                 Key: PHOENIX-3683
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3683
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Mujtaba Chohan
>            Assignee: Samarth Jain
>             Fix For: 4.10.0
>
>         Attachments: PHOENIX-3683.patch
>
>
> Query with joins returns null when client is v4.8.0 and server is 4.x head with https://github.com/apache/phoenix/pull/232  and https://issues.apache.org/jira/browse/PHOENIX-3678 patch applied.
> {noformat}
> CREATE TABLE Employee (
>     Region VARCHAR NOT NULL,
>     LocalID VARCHAR NOT NULL,
>     Name VARCHAR,
>     CONSTRAINT pk PRIMARY KEY (Region, LocalID));
> CREATE TABLE Patent (
>     PatentID VARCHAR NOT NULL,
>     Region VARCHAR,
>     LocalID VARCHAR,
>     Title VARCHAR,
>     Category VARCHAR,
>     CONSTRAINT pk PRIMARY KEY (PatentID));
> upsert into employee values ('region1','local1','foo');
> upsert into patent values ('patent1', 'region1','local1','title1','cat1');
> SELECT E.Name, E.Region, P.PCount
> FROM Employee AS E
> JOIN
>     (SELECT Region, LocalID, count(*) AS PCount
>      FROM Patent
>      GROUP BY Region, LocalID) AS P
> ON E.Region = P.Region AND E.LocalID = P.LocalID;
> {noformat}
> Resultset returns
> {noformat}
> +---------+-----------+-----------+
> | E.NAME  | E.REGION  | P.PCOUNT  |
> +---------+-----------+-----------+
> |         | region1   | null      |
> +---------+-----------+-----------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)