my-ship-it commented on code in PR #1310:
URL: https://github.com/apache/cloudberry/pull/1310#discussion_r2282099249


##########
src/backend/gporca/libgpopt/src/xforms/CSubqueryHandler.cpp:
##########
@@ -765,27 +764,17 @@ CSubqueryHandler::FCreateOuterApplyForScalarSubquery(
                                                CUtils::PexprScalarIdent(mp, 
pcrComputed),
                                                
CUtils::PexprScalarConstInt8(mp, 0 /*val*/));
 
-               if (fGeneratedByQuantified)
-               {
-                       // we produce Null if count(*) value is -1,
-                       // this case can only occur when transforming 
quantified subquery to
-                       // count(*) subquery using CXformSimplifySubquery
-                       pmdidInt8->AddRef();
-                       *ppexprResidualScalar = GPOS_NEW(mp) CExpression(
-                               mp, GPOS_NEW(mp) CScalarIf(mp, pmdidInt8),
-                               CUtils::PexprScalarEqCmp(
-                                       mp, pcrComputed,
-                                       CUtils::PexprScalarConstInt8(mp, -1 
/*value*/)),
-                               CUtils::PexprScalarConstInt8(mp, 0 /*value*/, 
true /*is_null*/),
-                               pexprCoalesce);
-               }
-               else
-               {
-                       // count(*) value can either be NULL (if produced by a 
lower outer join), or some value >= 0,
-                       // we return coalesce(count(*), 0) in this case
-
-                       *ppexprResidualScalar = pexprCoalesce;
-               }
+               // we produce Null if count(*) value is -1,

Review Comment:
   Why we change logic here?



-- 
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