apache / cloudberry

One advanced and mature open-source MPP (Massively Parallel Processing) database. Open source alternative to Greenplum Database.
https://cloudberry.apache.org
Apache License 2.0
430 stars 104 forks source link

Cherry-pick: Fix CDatumSortedSet handling of empty arrays causing errors in ORCA #643

Closed jiaqizho closed 1 month ago

jiaqizho commented 1 month ago

Previously, when constructing CDatumSortedSet from an array expression with all NULL elements, the aprngdatum was becoming an empty array. This caused unexpected errors that could lead to ORCA fallback to the planner, or even coredump.

The bug has been fixed by ensuring that no unnecessary operations are performed on the empty aprngdatum array.

fix #ISSUE_Number


Change logs

Describe your change clearly, including what problem is being solved or what feature is being added.

If it has some breaking backward or forward compatibility, please clary.

Why are the changes needed?

Describe why the changes are necessary.

Does this PR introduce any user-facing change?

If yes, please clarify the previous behavior and the change this PR proposes.

How was this patch tested?

Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.

Contributor's Checklist

Here are some reminders and checklists before/when submitting your pull request, please check them: