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(expr): implementation for char_length operation #2991

Merged
merged 4 commits into from
Jun 8, 2022

Conversation

nasnoisaac
Copy link
Contributor

@nasnoisaac nasnoisaac commented Jun 6, 2022

What's changed and what's your intention?

implement char_length operation

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

related issue #112

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #2991 (b24f9f9) into main (109e7d0) will decrease coverage by 0.00%.
The diff coverage is 45.45%.

@@            Coverage Diff             @@
##             main    #2991      +/-   ##
==========================================
- Coverage   73.25%   73.25%   -0.01%     
==========================================
  Files         730      730              
  Lines       98392    98399       +7     
==========================================
+ Hits        72080    72082       +2     
- Misses      26312    26317       +5     
Flag Coverage Δ
rust 73.25% <45.45%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/expr/src/expr/expr_unary.rs 74.43% <0.00%> (-1.08%) ⬇️
src/expr/src/expr/mod.rs 48.88% <ø> (ø)
src/expr/src/vector_op/length.rs 100.00% <100.00%> (ø)
src/frontend/src/binder/expr/function.rs 79.47% <100.00%> (+0.27%) ⬆️
src/frontend/src/expr/type_inference.rs 99.00% <100.00%> (ø)
src/meta/src/hummock/mock_hummock_meta_client.rs 43.82% <0.00%> (-1.13%) ⬇️
src/storage/src/hummock/compactor.rs 69.86% <0.00%> (-0.18%) ⬇️
src/storage/src/hummock/local_version_manager.rs 84.12% <0.00%> (-0.16%) ⬇️
src/meta/src/hummock/hummock_manager.rs 86.96% <0.00%> (+0.10%) ⬆️
src/common/src/types/ordered_float.rs 24.90% <0.00%> (+0.19%) ⬆️
... and 1 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@@ -289,6 +289,11 @@ pub fn new_unary_expr(
return_type,
ascii,
)),
(ProstType::CharLength, _, _) => Box::new(UnaryExpression::<Utf8Array, I64Array, _>::new(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
By https://www.postgresql.org/docs/9.1/functions-string.html and https://www.postgresql.org/docs/current/datatype.html,
it seems the data type of the return value should be signed four-byte integer

@nasnoisaac nasnoisaac requested a review from lmatz June 7, 2022 14:33
Copy link
Contributor

@lmatz lmatz left a comment

Choose a reason for hiding this comment

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

LGTM!

@lmatz lmatz enabled auto-merge (squash) June 8, 2022 04:22
@lmatz lmatz disabled auto-merge June 8, 2022 04:23
@lmatz lmatz merged commit 5e113d7 into risingwavelabs:main Jun 8, 2022
@nasnoisaac nasnoisaac deleted the char-len branch June 8, 2022 14:51
@stdrc stdrc mentioned this pull request Jun 28, 2022
20 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.

2 participants