Skip to content

feat(expr): support trim_array - #9265

Merged
Honeta merged 6 commits into
mainfrom
xinjing/trim_array
Apr 20, 2023
Merged

Honeta merged 6 commits into
mainfrom
xinjing/trim_array

Conversation

@Honeta

@Honeta Honeta commented Apr 19, 2023 •

Copy link
Copy Markdown
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

trim_array ( array anyarray, n integer ) → anyarray

Trims an array by removing the last n elements. If the array is multidimensional, only the first dimension is trimmed.

close #9264

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • SQL commands, functions, and operators

Release note

https://www.postgresql.org/docs/current/functions-array.html

@Honeta
Honeta requested review from st1page and xiangjinwu April 19, 2023 04:52
@github-actions github-actions Bot added the type/feature Type: New feature. label Apr 19, 2023

@st1page st1page left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally LGTM.
Btw, should we support visibility bitmap in the Array(List) Type? I am not sure about there use case and workload 🤔

Comment thread proto/expr.proto
@codecov

codecov Bot commented Apr 19, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #9265 (6eeb4d1) into main (1fd0394) will decrease coverage by 0.02%.
The diff coverage is 6.66%.

@@            Coverage Diff             @@
##             main    #9265      +/-   ##
==========================================
- Coverage   70.80%   70.79%   -0.02%     
==========================================
  Files        1216     1217       +1     
  Lines      202303   202333      +30     
==========================================
  Hits       143246   143246              
- Misses      59057    59087      +30     
Flag Coverage Δ
rust 70.79% <6.66%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
src/expr/src/expr/mod.rs 65.51% <ø> (ø)
src/frontend/src/expr/pure.rs 94.73% <ø> (ø)
src/frontend/src/expr/type_inference/func.rs 80.53% <0.00%> (-0.57%) ⬇️
src/expr/src/expr/expr_trim_array.rs 4.34% <4.34%> (ø)
src/frontend/src/binder/expr/function.rs 89.57% <100.00%> (+0.01%) ⬆️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment thread src/frontend/src/expr/type_inference/func.rs Outdated
Comment thread src/expr/src/expr/expr_trim_array.rs Outdated
Comment thread src/expr/src/expr/expr_trim_array.rs Outdated
@Honeta
Honeta requested a review from xiangjinwu April 20, 2023 03:17
@Honeta
Honeta enabled auto-merge April 20, 2023 03:38
@Honeta
Honeta added this pull request to the merge queue Apr 20, 2023
Merged via the queue into main with commit 2334e07 Apr 20, 2023
@Honeta
Honeta deleted the xinjing/trim_array branch April 20, 2023 04:09
Honeta added a commit that referenced this pull request Apr 20, 2023
@Honeta Honeta added the user-facing-changes Contains changes that are visible to users label Apr 26, 2023
@hengm3467 hengm3467 added the 📖✓ Covered or will be covered in the user docs. label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type: New feature. user-facing-changes Contains changes that are visible to users 📖✓ Covered or will be covered in the user docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement trim_array

4 participants