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 HEX, UNHEX, QUOTE, LTRIM, RTRIM scalar functions. #3116

Merged
merged 2 commits into from
Nov 26, 2021

Conversation

sunli829
Copy link
Contributor

@sunli829 sunli829 commented Nov 26, 2021

I hereby agree to the terms of the CLA available at: https://databend.rs/policies/cla/

Summary

Add HEX, UNHEX, QUOTE, LTRIM, RTRIM scalar functions.

Changelog

  • New Feature

Related Issues

fixes #3041 fixes #3036 fixes #3027 fixes #3031 fixes #3073 fixes #3061 fixes #3047

Test Plan

Unit Tests

Stateless Tests

@databend-bot databend-bot added the pr-feature this PR introduces a new feature to the codebase label Nov 26, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

1 similar comment
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2021

Codecov Report

Merging #3116 (a0421ba) into main (fdaa16e) will decrease coverage by 0%.
The diff coverage is 9%.

Impacted file tree graph

@@          Coverage Diff           @@
##            main   #3116    +/-   ##
======================================
- Coverage     68%     67%    -1%     
======================================
  Files        658     667     +9     
  Lines      34519   34793   +274     
======================================
+ Hits       23545   23586    +41     
- Misses     10974   11207   +233     
Impacted Files Coverage Δ
common/functions/src/scalars/strings/oct.rs 6% <ø> (ø)
common/functions/src/scalars/strings/hex.rs 6% <6%> (ø)
common/functions/src/scalars/strings/quote.rs 7% <7%> (ø)
common/functions/src/scalars/strings/ltrim.rs 9% <9%> (ø)
common/functions/src/scalars/strings/rtrim.rs 9% <9%> (ø)
common/functions/src/scalars/strings/unhex.rs 9% <9%> (ø)
common/functions/src/scalars/strings/string.rs 90% <100%> (+7%) ⬆️
common/datavalues/src/types/data_type_coercion.rs 54% <0%> (-6%) ⬇️
query/src/common/mod.rs 68% <0%> (-3%) ⬇️
query/src/sql/plan_parser_test.rs 100% <0%> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdaa16e...a0421ba. Read the comment docs.

@@ -25,5 +30,10 @@ impl StringFunction {
factory.register("substring", SubstringFunction::desc());
factory.register("oct", OctFunction::desc());
factory.register("repeat", RepeatFunction::desc());
factory.register("ltrim", LTrimFunction::desc());
Copy link
Member

Choose a reason for hiding this comment

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

Great, I have an idea about these functions.

They have the same return_type and number of arguments and datatypes, the difference between them are X where string_array.append_option(X), so it's better to have a generic function to reduce the code size?

Refer: https://github.com/datafuselabs/databend/blob/main/common/functions/src/scalars/dates/number_function.rs#L475-L493

dependabot bot and others added 2 commits November 26, 2021 19:19
Bumps [tracing-bunyan-formatter](https://github.com/LukeMathWalker/tracing-bunyan-formatter) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/LukeMathWalker/tracing-bunyan-formatter/releases)
- [Commits](LukeMathWalker/tracing-bunyan-formatter@v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: tracing-bunyan-formatter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@sunli829
Copy link
Contributor Author

done. 🙂

@BohuTANG BohuTANG merged commit 295c4d3 into databendlabs:main Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment