You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Mujtaba Chohan (JIRA)" <ji...@apache.org> on 2017/02/16 19:39:42 UTC

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

Mujtaba Chohan created PHOENIX-3683:
---------------------------------------

             Summary: 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


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)