Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/624#discussion_r72864739
  
    --- Diff: core/sql/optimizer/NormRelExpr.cpp ---
    @@ -3044,14 +3044,23 @@ Join::pullUpGroupByTransformation()
     //             a copy of join as the child. The original tree has not 
changed.
     //             The predicates in the new groupBy and the new Join will have
     //             changed according to the comments above.
    +//
     
------------------------------------------------------------------------------*/
     GroupByAgg* Join::pullUpGroupByTransformation(NormWA& normWARef)
     {
       CollHeap *stmtHeap = CmpCommon::statementHeap() ;
     
    -  // Determine a set of unique columns for the left sub-tree
    +  // Determine a set of unique columns for the left sub-tree.
    +
    +  // Note: Scans and joins synthesize uniqueness constraints even for
    +  // columns that are not in the characteristic outputs. Other
    +  // operators such as groupby or union don't. We make use of these
    +  // extra uniqeness constraints here. Any needed columns not yet
    +  // added to the characteristic outputs will be added later, in
    +  // method getMoreOutputsIfPossible().
    +
       ValueIdSet leftUniqueCols ;
    -  if (NOT (child(0)-getGroupAttr()->findUniqueCols(leftUniqueCols)))
    +  if (NOT (child(0)->getGroupAttr()->findUniqueCols(leftUniqueCols)))
    --- End diff --
    
    In answer to @selvaganesang, it called 
getGroupAttr()->findUniqueCols(leftUniqueCols) on "this", and subtracted that 
results (an NABoolean?) from the pointer child(0). That would almost always be 
non-zero. So the NOT would render it zero, and the "if" would not be taken.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to