Waloid24 commented on code in PR #2067:
URL: https://github.com/apache/cloudberry/pull/2067#discussion_r4147313859


##########
src/backend/gporca/libnaucrates/src/statistics/CFilterStatsProcessor.cpp:
##########
@@ -461,9 +461,6 @@ CFilterStatsProcessor::MakeHistHashMapConjFilter(
        // scaling factor of the last predicate
        scale_factors->Append(GPOS_NEW(mp) CDouble(last_scale_factor));
 
-       GPOS_ASSERT(nullptr != scale_factors);
-       CScaleFactorUtils::SortScalingFactor(scale_factors, true /* fDescending 
*/);

Review Comment:
   Because we will sort `scale_factors` in the next line inside 
`CalcScaleFactorCumulativeConj()` in the same order (descending) as here. I 
mentioned it in the description. 
   
   The current version has:
   ```
        GPOS_ASSERT(nullptr != scale_factors);
        CScaleFactorUtils::SortScalingFactor(scale_factors, true /* fDescending 
*/);
        *scale_factor = CScaleFactorUtils::CalcScaleFactorCumulativeConj(
                stats_config, scale_factors);
   ```
   
   Inside `CScaleFactorUtils::CalcScaleFactorCumulativeConj()` we will sort 
`scale_factors` if number of elements inside it is more than 1 (otherwise 
sorting doesn't matter). 
   
   So I suggest to remove `CScaleFactorUtils::SortScalingFactor(scale_factors, 
true /* fDescending */)` from the call site.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to