trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andyyangcn <>
Subject [GitHub] trafodion pull request #1543: [TRAFODION 3047] Cannot get right result using...
Date Wed, 02 May 2018 07:25:08 GMT
Github user andyyangcn commented on a diff in the pull request:
    --- Diff: core/sql/optimizer/RelExpr.cpp ---
    @@ -7880,11 +7880,17 @@ NABoolean GroupByAgg::tryToPullUpPredicatesInPreCodeGen(
             pulledPredicates += tempPulledPreds;
    +      // just remove pulled up predicates from char. input
    +      ValueIdSet newInputs(getGroupAttr()->getCharacteristicInputs());
    +      myLocalExpr += selectionPred();
    +      myLocalExpr -= tempPulledPreds;
    +      myLocalExpr.weedOutUnreferenced(newInputs);
    --- End diff --
    For my test case, in the code you mentioned above, selectionPred() and tempPulledPreds
is the same, and myLocalExpr doesn't include the dynamic parameter "?", but the dynamic parameter
"?" is included in variable newInputs. So after myLocalExpr.weedOutUnreferenced(newInputs),
the dynamic parameter "?" is removed from newINputs. And actually the predicate with dynamic
parameter in this case is not pulled up. That cause we have a predicate with an expression
"?" in selection predicate, but don't have the expression in character input. To my understand,
character inputs are needed by selection predicates. 
    So, for this fix, I recompute the character input and just remove the expressions which
are included in pulled up predicates.


View raw message