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

Peeyush Gupta updated ASTERIXDB-3515:
-------------------------------------
    Description: 
Create the following UDF
{noformat}
CREATE FUNCTION check(x)  {    
   select case when x=x then 10 else 0 end
}
{noformat}
The following query returns 0 instead of 10
{noformat}
select check(random()) 
{noformat}
We should not inline non-pure functions in UDF body.

  was:
Create the following UDF
{noformat}
CREATE FUNCTION check(x)  {    select case when x=x then 10 else 0 end
}
{noformat}
The following query returns 0 instead of 10
{noformat}
select check(random()) 
{noformat}
We should not inline non-pure functions in UDF body.


> Incorrect result when non-pure function passed as udf argument
> --------------------------------------------------------------
>
>                 Key: ASTERIXDB-3515
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3515
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>            Reporter: Peeyush Gupta
>            Priority: Major
>
> Create the following UDF
> {noformat}
> CREATE FUNCTION check(x)  {    
>    select case when x=x then 10 else 0 end
> }
> {noformat}
> The following query returns 0 instead of 10
> {noformat}
> select check(random()) 
> {noformat}
> We should not inline non-pure functions in UDF body.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to