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): support array_position and array_replace for 1d scenario #10166

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

xiangjinwu
Copy link
Contributor

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

What's changed and what's your intention?

Support the following array functions in PostgreSQL:

  • array_position ( anycompatiblearray, anycompatible [, integer ] ) → integer
  • array_remove ( anycompatiblearray, anycompatible ) → anycompatiblearray

Limitation:

  • We do not support recursively replacing the base element of a multidimensional array yet. (select array_replace(array[array[array[0, 1], array[2, 3]], array[array[4, 5], array[6, 7]]], 3, 9);)

Checklist For Contributors

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

Documentation

Types of user-facing changes

  • SQL commands, functions, and operators

Release note

Support the following array functions in PostgreSQL:

  • array_position ( anycompatiblearray, anycompatible [, integer ] ) → integer
  • array_remove ( anycompatiblearray, anycompatible ) → anycompatiblearray

When the array is multidimensional, the element need to be an array of one less dimension. array_remove does not support recursively replacing the base element of a multidimensional array yet.

@github-actions github-actions bot added type/feature user-facing-changes Contains changes that are visible to users labels Jun 5, 2023
@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #10166 (94588dc) into main (cd71052) will decrease coverage by 0.03%.
The diff coverage is 22.22%.

@@            Coverage Diff             @@
##             main   #10166      +/-   ##
==========================================
- Coverage   70.91%   70.88%   -0.03%     
==========================================
  Files        1234     1235       +1     
  Lines      211161   211260      +99     
==========================================
+ Hits       149742   149760      +18     
- Misses      61419    61500      +81     
Flag Coverage Δ
rust 70.88% <22.22%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
src/frontend/src/expr/pure.rs 93.44% <ø> (ø)
src/frontend/src/expr/type_inference/func.rs 79.04% <0.00%> (-2.31%) ⬇️
src/expr/src/vector_op/array_positions.rs 5.26% <5.26%> (ø)
src/expr/src/vector_op/array_replace.rs 52.94% <52.94%> (ø)
src/frontend/src/binder/expr/function.rs 88.34% <100.00%> (+0.03%) ⬆️

... and 8 files with indirect coverage changes

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

@xiangjinwu xiangjinwu requested review from Honeta and st1page June 5, 2023 10:15
Copy link
Contributor

@st1page st1page left a comment

Choose a reason for hiding this comment

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

LGTM

@xiangjinwu xiangjinwu added this pull request to the merge queue Jun 6, 2023
Merged via the queue into main with commit 572780b Jun 6, 2023
@xiangjinwu xiangjinwu deleted the feat-expr-array-pos-replace branch June 6, 2023 10:30
@bernscode bernscode added the 📖✓ Covered or will be covered in the user docs. label Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/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.

3 participants