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

Leonard Xu updated FLINK-14886:
-------------------------------
    Description: 
Sorry for close this issue becasue I didn't  find the precise root cause. 
But I have some conclusion as following, and I’ll open a new issue if I have 
positive progress. 

!screenshot-2.png!  
!Flink.png! 

  was:
 

In TPC-DS query6.sql, I found the query result is incorrect, I analyze the root 
cause and simplify the issue as following:
{code:java}
create table t(
  a varchar(100),
  b float
);
insert into t(a,b) values('boy', 100);
insert into t(a,b) values(null, 50);

select t1.a, t1.b, (select avg(t2.b)
                      from t t2   
                    where t2.a = t1.a) 
from t t1;

{code}
the result when use blink planner is:
{code:java}
|  a  |  b  | EXP |
|-----|-----|-----|
|  boy|  100|  100|
| null|   50|  100| 
{code}
but correct result should be :
{code:java}
|  a  |  b  | EXP |
|-----|-----|-----|
|  boy|  100|  100|
| null|   50| null| 
{code}
 Both flink legacy planner and other DB system can produce the correct result. 


> Wrong result in scalar query using blink planner
> ------------------------------------------------
>
>                 Key: FLINK-14886
>                 URL: https://issues.apache.org/jira/browse/FLINK-14886
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.9.1
>            Reporter: Leonard Xu
>            Priority: Blocker
>             Fix For: 1.10.0, 1.9.2
>
>         Attachments: Flink.png, screenshot-1.png, screenshot-2.png
>
>
> Sorry for close this issue becasue I didn't  find the precise root cause. 
> But I have some conclusion as following, and I’ll open a new issue if I have 
> positive progress. 
> !screenshot-2.png!  
> !Flink.png! 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to