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

feat: support greatest function #2490

Merged

Conversation

NiwakaDev
Copy link
Collaborator

@NiwakaDev NiwakaDev commented Sep 25, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR adds support greatest(Date, Date) like this:

select GREATEST('1999-01-30', '2023-03-01');

Will generate:

+-------------------------------------------------+
| greatest(Utf8("1999-01-30"),Utf8("2023-03-01")) |
+-------------------------------------------------+
| 2023-03-01                                      |
+-------------------------------------------------+

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Related to #1536.

Resources

This PR is based on:

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #2490 (fd6f82d) into develop (40781ec) will increase coverage by 0.06%.
Report is 35 commits behind head on develop.
The diff coverage is 77.51%.

❗ Current head fd6f82d differs from pull request most recent head 4e2539a. Consider uploading reports for the commit 4e2539a to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2490      +/-   ##
===========================================
+ Coverage    84.83%   84.90%   +0.06%     
===========================================
  Files          726      730       +4     
  Lines       115028   116085    +1057     
===========================================
+ Hits         97586    98558     +972     
- Misses       17442    17527      +85     

Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

Almost LGTM, a little suggestion. Thank u very much.

src/common/function/src/scalars/timestamp/greatest.rs Outdated Show resolved Hide resolved
@killme2008
Copy link
Contributor

@waynexia PTAL

Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

rest LGTM

src/common/function/src/scalars/timestamp/greatest.rs Outdated Show resolved Hide resolved
@killme2008 killme2008 added this pull request to the merge queue Sep 28, 2023
Merged via the queue into GreptimeTeam:develop with commit 04dbd83 Sep 28, 2023
12 checks passed
@killme2008
Copy link
Contributor

@NiwakaDev Thank you for your contribution and patience.

paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: support greatest function

* feat: make greatest take date_type as input

* fix: move sqlness test into common/function/time.sql

* fix: avoid using unwarp

* fix: use downcast

* refactor: simplify arrow cast
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.

3 participants