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

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

GitHub user zellerh opened a pull request:

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

    [TRAFODION-2130] Incorrect subquery unnesting

    A missing ">" character caused us to do an unnesting transformation
    without having uniqueness constraint on the main query.
    
    Note that this is a rare case, since most tables have unique columns
    and since the code tries to get those unique columns if they are not
    already included.

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

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

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

    https://github.com/apache/incubator-trafodion/pull/624.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 #624
    
----
commit 1ca26fc8fbfa9cb12dd37f453b71034db3372c82
Author: Hans Zeller <hzel...@apache.org>
Date:   2016-07-28T17:39:55Z

    [TRAFODION-2130] Incorrect subquery unnesting
    
    A missing ">" character caused us to do an unnesting transformation
    without having uniqueness constraint on the main query.
    
    Note that this is a rare case, since most tables have unique columns
    and since the code tries to get those unique columns if they are not
    already included.

----


> Incorrect subquery transformation for tables w/o key
> ----------------------------------------------------
>
>                 Key: TRAFODION-2130
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2130
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 1.2-incubating
>            Reporter: Hans Zeller
>            Assignee: Hans Zeller
>
> Some of the subquery unnesting transformations rely on a unique key on the 
> result of the main query. It turns out, however, that the transformation 
> happens even if there is no unique key. Example:
> select *
> from (values (1,1), (1,1), (2,2)) T(a,b)
> where t.a in (select max(a)
>               from (values (1,1), (1,1), (3,3)) S(a,b)
>               where S.b = T.b);
> This should return two rows, but it actually just returns one, because it 
> does not include a unique key for the main query, T.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to