[ 
https://issues.apache.org/jira/browse/PHOENIX-5413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16899315#comment-16899315
 ] 

Hadoop QA commented on PHOENIX-5413:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  
http://issues.apache.org/jira/secure/attachment/12976391/PHOENIX-5413.master.v1.patch
  against master branch at commit 12c538ce2db4779b91bc294ebe8e4880673ff8c2.
  ATTACHMENT ID: 12976391

    {color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
                        Please justify why no new tests are needed for this 
patch.
                        Also please list what manual steps were performed to 
verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

    {color:red}-1 release audit{color}.  The applied patch generated 1 release 
audit warnings (more than the master's current 0 warnings).

    {color:green}+1 lineLengths{color}.  The patch does not introduce lines 
longer than 100

     {color:red}-1 core tests{color}.  The patch failed these unit tests:
                       org.apache.phoenix.compile.QueryCompilerTest

Test results: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2868//testReport/
Release audit warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2868//artifact/patchprocess/patchReleaseAuditWarnings.txt
Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2868//console

This message is automatically generated.

> 'case when' return a wrong result  when working on  a union all  Subquery 
> --------------------------------------------------------------------------
>
>                 Key: PHOENIX-5413
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5413
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.14.1
>            Reporter: liushuo
>            Priority: Major
>         Attachments: PHOENIX-5413.master.v1.patch, 
> image-2019-07-25-16-32-58-194.png
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
>  
> {code:java}
> create table user_props (csid varchar primary key, dim varchar, dvalue 
> varchar);
> UPSERT INTO user_props (csid,dim,dvalue) 
> VALUES('a','ppl_peopleMainsiteCenter','4') ;
> UPSERT INTO user_props (csid,dim,dvalue) 
> VALUES('b','ppl_peopleMainsiteCenter','4') ;
> UPSERT INTO user_props (csid,dim,dvalue) 
> VALUES('c','ppl_peopleMainsiteCenter','4') ;
> create table id_cs1_mapping (id varchar primary key,cs1 varchar);
> UPSERT INTO id_cs1_mapping (id,cs1) VALUES('a','1111');
> UPSERT INTO id_cs1_mapping (id,cs1) VALUES('b','2222');
> UPSERT INTO id_cs1_mapping (id,cs1) VALUES('c','3333');{code}
>  sql:
>   
> {code:java}
> SELECT 
>    csid, 
>    case 
>      WHEN dim='ppl_peopleMainsiteCenter' 
>      THEN dvalue ELSE NULL 
>    end ppl_peopleMainsiteCenter 
> FROM ( 
>   SELECT 
>     csid, dim, dvalue 
>   FROM user_props 
>   
>   UNION all 
>   
>   SELECT 
>     id csid, 'cs1' dim, cs1 dvalue 
>   FROM id_cs1_mapping 
> ) t   {code}
> result:
> ||csid||ppl_peopleMainsiteCenter||
> |a|null|
> |b|null|
> |c|null|
> |a|null|
> |b|null|
> |c|null|
> but, i expect 
> ||csid||ppl_peopleMainsiteCenter||
> |a|null|
> |b|null|
> |c|null|
> |a|4|
> |b|4|
> |c|4|
> debug code, i found that  
> {code:java}
> case WHEN dim='ppl_peopleMainsiteCenter' THEN dvalue ELSE NULL end{code}
>  is compiled 
> {code:java}
> case WHEN fase THEN dvalue ELSE NULL end{code}
> I think the error result due to  'ComparisonExpression.java'  line : 248, so 
> that the result of  ' if '  is true。
> maybe, add the condition ' lhsExprDataType.isFixedWidth() '. so, i get the 
> expected result.
> !image-2019-07-25-16-32-58-194.png!



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to