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

Add coalesce function #513

Merged
merged 9 commits into from
Nov 23, 2023
Merged

Add coalesce function #513

merged 9 commits into from
Nov 23, 2023

Conversation

yaziine
Copy link
Collaborator

@yaziine yaziine commented Nov 21, 2023

This PR fixes #509 by adding support to COALESCE method.
Unlike PosgreSQL, our implementation doesn't fail if the arguments aren't of the same type.
However, an error is returned if there is no argument at all.

@yaziine yaziine requested a review from asdine November 21, 2023 17:07
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (6dc2964) 78.94% compared to head (31c0128) 78.87%.
Report is 1 commits behind head on main.

❗ Current head 31c0128 differs from pull request most recent head e065575. Consider uploading reports for the commit e065575 to get more accurate results

Files Patch % Lines
internal/expr/functions/builtins.go 53.33% 6 Missing and 1 partial ⚠️
internal/expr/functions/definition.go 33.33% 1 Missing and 1 partial ⚠️
internal/sql/parser/parser.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
- Coverage   78.94%   78.87%   -0.07%     
==========================================
  Files         126      126              
  Lines       10890    10907      +17     
==========================================
+ Hits         8597     8603       +6     
- Misses       1571     1579       +8     
- Partials      722      725       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yaziine yaziine requested a review from asdine November 23, 2023 06:55
Copy link
Collaborator

@asdine asdine left a comment

Choose a reason for hiding this comment

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

👏🏼

@asdine asdine merged commit 79af2d0 into main Nov 23, 2023
1 check failed
@asdine asdine deleted the coalesce branch November 23, 2023 07:07
@asdine asdine added this to the v0.16.0 milestone Nov 28, 2023
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.

Functions: COALESCE
2 participants