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: add build() function to return the database build info #2919

Merged
merged 6 commits into from Dec 13, 2023

Conversation

Dysprosium0626
Copy link
Contributor

build() function to return the database build info #2909

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Add build that returns the database build info looks like this:

mysql> select build()\G;
*************************** 1. row ***************************
build(): branch: feat/add-build-udf
commit: 106d60b6bd748e6527fecbebb5010dcba1b8e089
commit short: 106d60b
dirty: true
version: 0.4.4
1 row in set (0.07 sec)

ERROR:
No query specified

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 issue #2909

build() function to return the database build info GreptimeTeam#2909
@Dysprosium0626
Copy link
Contributor Author

I am wondering should we put function.rs and function_registry.rs from src/common/function/src/scalars to src/common/function since they now support both scalars and system UDFs.

@waynexia
Copy link
Member

waynexia commented Dec 12, 2023

Can you also add some corresponding sqlness cases? It's our integration test framework.

And since the build info is changing, you may need this interceptor to fix the output result.

@Dysprosium0626
Copy link
Contributor Author

Can you also add some corresponding sqlness cases? It's our integration test framework.

And since the build info is changing, you may need this interceptor to fix the output result.

Sure

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #2919 (f3c52ff) into develop (47e5154) will decrease coverage by 0.52%.
Report is 11 commits behind head on develop.
The diff coverage is 93.10%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2919      +/-   ##
===========================================
- Coverage    85.11%   84.59%   -0.52%     
===========================================
  Files          756      752       -4     
  Lines       119511   119317     -194     
===========================================
- Hits        101719   100937     -782     
- Misses       17792    18380     +588     

@killme2008
Copy link
Contributor

I am wondering should we put function.rs and function_registry.rs from src/common/function/src/scalars to src/common/function since they now support both scalars and system UDFs.

Good question! I think we can refactor them later.

src/common/function/src/system/build.rs Outdated Show resolved Hide resolved
src/common/function/src/system/build.rs Outdated Show resolved Hide resolved
src/common/function/Cargo.toml Outdated Show resolved Hide resolved
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

src/common/function/src/system.rs Outdated Show resolved Hide resolved
@killme2008
Copy link
Contributor

killme2008 commented Dec 13, 2023

@Dysprosium0626 Have some code format issues and cargo-clippy warnings.

You can format the code by cargo fmt.

Find all warnings by cargo clippy --workspace --all-targets -- -D warnings, please fix them all.

Copy link
Member

@WenyXu WenyXu 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/system/build.rs Outdated Show resolved Hide resolved
Co-authored-by: Weny Xu <wenymedia@gmail.com>
@WenyXu
Copy link
Member

WenyXu commented Dec 13, 2023

@Dysprosium0626 Have some code format issues and cargo-clippy warnings.

You can format the code by cargo fmt.

Find all warnings by cargo clippy --workspace --all-targets -- -D warnings, please fix them all.

BTW, there is a shortcut; just make clippy.

@killme2008 killme2008 added this pull request to the merge queue Dec 13, 2023
Merged via the queue into GreptimeTeam:develop with commit 3d65152 Dec 13, 2023
13 checks passed
@Dysprosium0626 Dysprosium0626 deleted the feat/add-build-udf branch December 13, 2023 09:13
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.

None yet

4 participants