Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array_join adds an extra delimeter if the last element is null #22652

Merged
merged 1 commit into from
May 3, 2024

Conversation

kevinwilfong
Copy link
Contributor

@kevinwilfong kevinwilfong commented May 1, 2024

Description

array_join adds an extra trailing delimeter to the result string if the last element in the array is null

Motivation and Context

this seems to be clearly incorrect, if the null replacement argument isn't set nulls are otherwise ignored by array_join

Impact

this will change the results of array_join for cases where the last element is null

Test Plan

added a testcase where the null replacement argument is not set and the last element is null, this was previously untested

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Fix array_join to not add a trailing delimeter when the last element in the array is NULL. :pr:`22652`

@kevinwilfong kevinwilfong requested review from a team as code owners May 1, 2024 21:40
@kevinwilfong kevinwilfong marked this pull request as draft May 1, 2024 21:43
@kevinwilfong kevinwilfong marked this pull request as ready for review May 1, 2024 22:01
@mbasmanova
Copy link
Contributor

CC: @tdcmeehan @aditi-pandit @steveburnett

@steveburnett
Copy link
Contributor

Nit: suggest adding the PR to the release note entry.

== RELEASE NOTES ==

General Changes
* Fix array_join to not add a trailing delimeter when the last element in the array is NULL. :pr:`22652`

Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Great fix, just some nits. Thanks!

@kevinwilfong
Copy link
Contributor Author

Thanks for the review!

@tdcmeehan tdcmeehan self-assigned this May 2, 2024
@tdcmeehan tdcmeehan merged commit 2381d19 into prestodb:master May 3, 2024
56 checks passed
@wanglinsong wanglinsong mentioned this pull request Jun 25, 2024
36 tasks
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.

4 participants