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): add _pg_expandarray function #12448

Merged
merged 6 commits into from
Sep 21, 2023
Merged

Conversation

wangrunji0408
Copy link
Contributor

@wangrunji0408 wangrunji0408 commented Sep 20, 2023

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

What's changed and what's your intention?

Added a new table function _pg_expandarray.

fix #12204

Checklist

  • 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).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

Add a new table function:

_pg_expandarray(array anyarray) → record(x anyelement, n int)

Returns the input array as a set of rows with an index.

@wangrunji0408
Copy link
Contributor Author

Is there a way to ignore the lint?

expr.proto:250:5:Enum value name "_PG_EXPANDARRAY" should be UPPER_SNAKE_CASE, such as "PG_EXPANDARRAY".

Copy link
Contributor

@TennyZhuang TennyZhuang left a comment

Choose a reason for hiding this comment

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

LGTM
It seems that buf lint does not support fine-grained ignoring. The only way is to name it as PG_EXPANDARRAY and rewrite it in the frontend.

@TennyZhuang
Copy link
Contributor

I found this.

https://buf.build/docs/lint/overview#ignore_only

Signed-off-by: Runji Wang <[email protected]>
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #12448 (7d1b6fd) into main (5a2ee63) will decrease coverage by 0.01%.
Report is 17 commits behind head on main.
The diff coverage is 42.85%.

@@            Coverage Diff             @@
##             main   #12448      +/-   ##
==========================================
- Coverage   69.64%   69.63%   -0.01%     
==========================================
  Files        1422     1423       +1     
  Lines      235747   235782      +35     
==========================================
+ Hits       164192   164198       +6     
- Misses      71555    71584      +29     
Flag Coverage Δ
rust 69.63% <42.85%> (-0.01%) ⬇️

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

Files Changed Coverage Δ
src/expr/macro/src/lib.rs 91.48% <ø> (ø)
src/expr/src/table_function/mod.rs 70.19% <ø> (ø)
src/frontend/src/binder/expr/function.rs 78.34% <0.00%> (-0.70%) ⬇️
src/expr/src/table_function/pg_expandarray.rs 28.57% <28.57%> (ø)
src/expr/macro/src/gen.rs 97.02% <100.00%> (+0.03%) ⬆️

... and 4 files with indirect coverage changes

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

@TennyZhuang
Copy link
Contributor

Signed-off-by: Runji Wang <[email protected]>
@wangrunji0408 wangrunji0408 added this pull request to the merge queue Sep 21, 2023
Merged via the queue into main with commit 77d78f0 Sep 21, 2023
@wangrunji0408 wangrunji0408 deleted the wrj/pg_expand_array branch September 21, 2023 06:04
@neverchanje neverchanje mentioned this pull request Dec 22, 2023
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metabase: support information_schema._pg_expandarray
3 participants