leborchuk commented on code in PR #1192:
URL: https://github.com/apache/cloudberry/pull/1192#discussion_r2278469528


##########
src/backend/gporca/libgpopt/src/operators/CPhysicalAgg.cpp:
##########
@@ -293,11 +292,65 @@ CDistributionSpec *
 CPhysicalAgg::PdsMaximalHashed(CMemoryPool *mp, CColRefArray *colref_array)
 {
        GPOS_ASSERT(nullptr != colref_array);
+       CColRefArray *pcraResHashs = nullptr;
+
+       if (GPOS_FTRACE(EopttraceAggRRSFirstKey)) {
+               pcraResHashs = GPOS_NEW(mp) CColRefArray(mp);
+               if (colref_array->Size() > 0) {
+                       CColRef *colref = (*colref_array)[0];
+                       pcraResHashs->Append(colref);
+               }
+       } else if (GPOS_FTRACE(EopttraceAggRRSMinimalLenKey)) {
+               ULONG ulsz = colref_array->Size();
+               pcraResHashs = GPOS_NEW(mp) CColRefArray(mp);
+
+               LINT minimal_typlen = gpos::lint_max; // less than minimal 
typlen
+               LINT minimal_typlen_ul = -1;
+               for (ULONG ul = 0; ul < ulsz; ul++) {
+                       CColRef *pcr =(*colref_array)[ul];
+                       const gpmd::IMDType *pmdtyp = pcr->RetrieveType();
+                       LINT typlen = pmdtyp->IsFixedLength() ? 
pmdtyp->Length() : (gpos::lint_max - 1);
+
+                       if (typlen < minimal_typlen) {
+                               minimal_typlen = typlen;
+                               minimal_typlen_ul = ul;
+                       }
+               }
+
+               if (minimal_typlen_ul != -1) {

Review Comment:
   Yep, the same as for the previos comment, not relevant, could be ignored



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