Skip to content

Conversation

yjhjstz
Copy link
Member

@yjhjstz yjhjstz commented Aug 12, 2025

Fixes #1309

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


if (0 == popAggOriginal->Pdrgpcr()->Size())
{
CColRef *pcrCount = nullptr;
if (CUtils::FHasCountAgg((*pexpr)[1], &pcrCount))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to process count star and count any here. But it's a general problem, namely, any AggFunc with not nulll initval we should process here.

Copy link
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We could process AggFunc with not null initvalue in future.

BOOL fGeneratedByQuantified = popSubquery->FGeneratedByQuantified();
if (fGeneratedByQuantified ||
(fHasCountAggMatchingColumn && 0 == pgbAgg->Pdrgpcr()->Size()))
if (fGeneratedByQuantified)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please add a test case, thanks!


*ppexprResidualScalar = pexprCoalesce;
}
// we produce Null if count(*) value is -1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we change logic here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] orca count bug

2 participants