[jira] [Commented] (TRAFODION-2611) Input parameters and current functions in input tables of TMUDFs

2017-05-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006985#comment-16006985
 ] 

ASF GitHub Bot commented on TRAFODION-2611:
---

GitHub user zellerh opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1092

[TRAFODION-2611] TMUDF with input parameters returns wrong answer

Also fixes for two more JIRAs:

[TRAFODION-2612] Internal error in CLEANUP in rare cases
[TRAFODION-2615] TMUDF returns wrong results with small numeric inputs

These three fixes are independent, so I would recommend reviewing each of 
the three commits separately.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zellerh/incubator-trafodion bug/cses_jan-17

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/1092.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1092






> Input parameters and current functions in input tables of TMUDFs
> 
>
> Key: TRAFODION-2611
> URL: https://issues.apache.org/jira/browse/TRAFODION-2611
> Project: Apache Trafodion
>  Issue Type: Bug
>  Components: sql-cmp
>Affects Versions: 2.0-incubating
> Environment: any
>Reporter: Hans Zeller
>Assignee: Hans Zeller
> Fix For: 2.2-incubating
>
> Attachments: EchoUdf.cpp
>
>
> When the input of a table-mapping UDF (TMUDF) contains a parameter or a 
> function that should be evaluated only once, such as current_timestamp, we do 
> not always set up the correct data flow. This is visible, for example, when 
> using a parallel UDF query that has "current_timestamp" as an input:
> {noformat}
> control query shape esp_exchange(cut,4);
> select * from udf(echo(table(select current_timestamp from tsrc 
> <<+cardinality 1e9>>)));
> execute s;
> {noformat}
> This query could return different timestamps, which is wrong, all rows should 
> have the same timestamp. A similar issue could happen with input parameters.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TRAFODION-2611) Input parameters and current functions in input tables of TMUDFs

2017-05-10 Thread Hans Zeller (JIRA)

[ 
https://issues.apache.org/jira/browse/TRAFODION-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16005395#comment-16005395
 ] 

Hans Zeller commented on TRAFODION-2611:


The bug is in TableMappingUDF::recomputeOuterReferences(). The outputs of the 
child query (including current_timestamp in this example) are stored in the 
TableMappingUDF node. It must add any outer references from these expressions 
to its own characteristic inputs.

> Input parameters and current functions in input tables of TMUDFs
> 
>
> Key: TRAFODION-2611
> URL: https://issues.apache.org/jira/browse/TRAFODION-2611
> Project: Apache Trafodion
>  Issue Type: Bug
>Affects Versions: 2.0-incubating
> Environment: any
>Reporter: Hans Zeller
>Assignee: Hans Zeller
> Fix For: 2.2-incubating
>
> Attachments: EchoUdf.cpp
>
>
> When the input of a table-mapping UDF (TMUDF) contains a parameter or a 
> function that should be evaluated only once, such as current_timestamp, we do 
> not always set up the correct data flow. This is visible, for example, when 
> using a parallel UDF query that has "current_timestamp" as an input:
> {noformat}
> control query shape esp_exchange(cut,4);
> select * from udf(echo(table(select current_timestamp from tsrc 
> <<+cardinality 1e9>>)));
> execute s;
> {noformat}
> This query could return different timestamps, which is wrong, all rows should 
> have the same timestamp.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)