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

Leonard Xu updated FLINK-14886:
-------------------------------
    Description: 
 

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| null| 
{code}
but correct result should be :
{code:java}
|  a  |  b  | EXP |
|-----|-----|-----|
|  boy|  100| null|
| null|   50| null| 
{code}
 Both flink legacy planner and other DB system can produce the correct result. 

  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| null| 
{code}
but correct result should be :
{code:java}
|  a  |  b  | EXP |
|-----|-----|-----|
|  boy|  100| null|
| 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
>
>
>  
> 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| null| 
> {code}
> but correct result should be :
> {code:java}
> |  a  |  b  | EXP |
> |-----|-----|-----|
> |  boy|  100| null|
> | null|   50| null| 
> {code}
>  Both flink legacy planner and other DB system can produce the correct 
> result. 



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

Reply via email to