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

    https://github.com/apache/trafodion/pull/1543#discussion_r185329230
  
    --- Diff: core/sql/optimizer/RelExpr.cpp ---
    @@ -7880,11 +7880,17 @@ NABoolean 
GroupByAgg::tryToPullUpPredicatesInPreCodeGen(
           else
             pulledPredicates += tempPulledPreds;
     
    +      // just remove pulled up predicates from char. input
    +      ValueIdSet newInputs(getGroupAttr()->getCharacteristicInputs());
    +      myLocalExpr += selectionPred();
    +      myLocalExpr -= tempPulledPreds;
    +      myLocalExpr.weedOutUnreferenced(newInputs);
    --- End diff --
    
    Could you explain what is going on in this code? I notice that earlier in 
the method we already added selectionPred() to myLocalExpr, and then removed 
tempPulledPreds. I'm wondering why we are doing this again. Also, It's not 
obvious to me why newInputs will have different values than myNewInputs, which 
went through a similar calculation. An example might help.


---

Reply via email to