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

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

GitHub user DaveBirdsall opened a pull request:

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

    [TRAFODION-2843] Fix outer join on aggregate bug

    Formerly, the code was allowing an uncovered aggregate expression to be 
generated as a before join predicate. This lead to a Generator assert. The test 
for uncovered expressions in Join::preCodeGen has been tightened up so this 
does not happen.

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

    $ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2843

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

    https://github.com/apache/incubator-trafodion/pull/1340.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 #1340
    
----
commit ccb17c28e7fa74b5c58dbf37a02239316184bdd5
Author: Dave Birdsall <dbirds...@apache.org>
Date:   2017-12-13T21:04:44Z

    [TRAFODION-2843] Fix outer join on aggregate bug

----


> Internal error (or core) on full outer join on an aggregate
> -----------------------------------------------------------
>
>                 Key: TRAFODION-2843
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2843
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.3-incubating
>         Environment: All
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>
> The following sqlci script demonstrates the problem. The "prepare x1" fails 
> with an error 7000 (generator internal error) on release builds, and cores on 
> debug builds.
> ?section setup
> drop schema if exists mytest cascade;
> create schema if not exists mytest;
> set schema mytest;
> Create table D03s
>                 (
>                 pk int not null not droppable primary key
>                 , val01 int
>                 , val02 int
>                 );
> Create table F01s
>                 (
>                   pk int not null not droppable primary key
>                 , fk_d01 int not null
>                 , fk_d02 int not null
>                 , fk_d03 int not null
>                 , fk_d04 int not null
>                 , fk_d05 int not null
>                 , fk_d06 int not null
>                 , fk_d07 int not null
>                 , fk_d08 int not null
>                 , fk_d09 int not null
>                 , fk_d10 int not null
>                 , val01 int
>                 , val02 int
>                 , val01_d01 int
>                 , val02_d01 int
>                 , val01_d02 int
>                 , val02_d02 int
>                 , val01_d03 int
>                 , val02_d03 int
>                 ) salt using 8 partitions;
> insert into D03s
>                 select c1+c2*10+c3*100, c1, c1+c2*10
>                 from (values(1)) T
>                 transpose 0,1 as c1
>                 transpose 0,1 as c2
>                 transpose 0,1 as c3;
> insert with no rollback into F01s
>                 select c1+c2*10+c3*100+c4*1000+c5*10000+c6*100000
>                       ,c1
>                       ,c1+c2*10
>                       ,c1+c2*10+c3*100
>                       ,c1
>                       ,c1+c2*10
>                       ,c1+c2*10+c3*100
>                       ,c1
>                       ,c1+c2*10
>                       ,c1+c2*10+c3*100
>                       ,c1
>                       ,c1+c2*10
>                       ,mod(c1+c2*100+c3*100,200)
>                       ,mod(c1,3)
>                       ,mod(c1,6)
>                       ,mod(c1+c2*10,5)
>                       ,c1
>                       ,c1
>                       ,c1+c2*10
>                 from (values(1)) T
>                 transpose 0,1 as c1
>                 transpose 0,1 as c2
>                 transpose 0,1 as c3
>                 transpose 0,1 as c4
>                 transpose 0 as c5
>                 transpose 0 as c6
>                 ;
> ?section testit
> set schema mytest;
> prepare x1 from
>                         select F01s.val01, TD03.val01
>                         From F01s 
>                         full outer join
>                           (select D03s.val01,count(D03s.pk)
>                           from D03s
>                           group by D03s.val01) as TD03(val01,pk) 
>                         on (TD03.pk=F01s.fk_d03
>                           AND TD03.pk>0 );



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to