You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiatao Tao (Jira)" <ji...@apache.org> on 2020/11/20 07:57:00 UTC

[jira] [Updated] (CALCITE-4413) Duplicate RAND() after optimizer

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

Jiatao Tao updated CALCITE-4413:
--------------------------------
    Description: 
In CsvTest:

SQL: 

 
{code:java}
select *
from
(
    select empno, rand(1) as ran
    from EMPS
    where gender <> 'M'
) t
where ran > 0.6
{code}
PLAN:

 

 
{code:java}
EnumerableProject(EMPNO=[$0], RAN=[RAND(1)])
  EnumerableInterpreter
    BindableTableScan(table=[[SALES, EMPS]], filters=[[AND(<>($3, 'M'), >(RAND(1), 0.6:DECIMAL(2, 1)))]])
{code}
We can see there are two RAND(1) and it changes the semantics.

 

 

> Duplicate RAND() after optimizer
> --------------------------------
>
>                 Key: CALCITE-4413
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4413
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Major
>
> In CsvTest:
> SQL: 
>  
> {code:java}
> select *
> from
> (
>     select empno, rand(1) as ran
>     from EMPS
>     where gender <> 'M'
> ) t
> where ran > 0.6
> {code}
> PLAN:
>  
>  
> {code:java}
> EnumerableProject(EMPNO=[$0], RAN=[RAND(1)])
>   EnumerableInterpreter
>     BindableTableScan(table=[[SALES, EMPS]], filters=[[AND(<>($3, 'M'), >(RAND(1), 0.6:DECIMAL(2, 1)))]])
> {code}
> We can see there are two RAND(1) and it changes the semantics.
>  
>  



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