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(common): introduce SerialArrayBuilder and SerialArray #8357

Merged
merged 8 commits into from
Mar 7, 2023

Conversation

shanicky
Copy link
Contributor

@shanicky shanicky commented Mar 6, 2023

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

What's changed and what's your intention?

Changes Made

  • Implemented HashKeySerDe for Serial
  • Added support for Serial to various functions and modules in the codebase
  • Defined SerialArrayBuilder and SerialArray types for building and representing arrays of Serial
  • Modified tests to reflect these changes

Purpose

The purpose of these changes is to add support for a new SERIAL type and enable its usage in various functions and modules in the codebase. This is done by defining SerialArrayBuilder and SerialArray types for building and representing arrays of Serial. The changes also include updating tests to reflect these new additions.

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.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@shanicky shanicky self-assigned this Mar 6, 2023
@shanicky shanicky force-pushed the peng/serial-1-array branch from 15ea0aa to f37ef4c Compare March 6, 2023 07:13
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Merging #8357 (5cd434b) into main (55d1438) will decrease coverage by 0.01%.
The diff coverage is 34.78%.

@@            Coverage Diff             @@
##             main    #8357      +/-   ##
==========================================
- Coverage   71.56%   71.56%   -0.01%     
==========================================
  Files        1132     1132              
  Lines      184249   184262      +13     
==========================================
+ Hits       131853   131858       +5     
- Misses      52396    52404       +8     
Flag Coverage Δ
rust 71.56% <34.78%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/common/src/array/arrow.rs 63.75% <0.00%> (-0.14%) ⬇️
src/common/src/array/mod.rs 72.70% <0.00%> (-0.37%) ⬇️
src/common/src/array/primitive_array.rs 90.10% <ø> (ø)
src/common/src/array/value_reader.rs 52.00% <ø> (ø)
src/common/src/hash/key.rs 82.37% <0.00%> (-0.88%) ⬇️
src/common/src/types/mod.rs 73.08% <0.00%> (-0.08%) ⬇️
src/common/src/types/native_type.rs 37.50% <0.00%> (-6.95%) ⬇️
src/common/src/array/serial_array.rs 12.90% <100.00%> (+12.90%) ⬆️
src/common/src/test_utils/rand_array.rs 100.00% <100.00%> (ø)
src/meta/src/hummock/mock_hummock_meta_client.rs 64.43% <0.00%> (-1.04%) ⬇️
... and 5 more

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

@shanicky shanicky requested review from xiangjinwu and st1page March 6, 2023 07:49
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

@shanicky shanicky added this pull request to the merge queue Mar 6, 2023
Comment on lines 96 to 100
#[derive(Debug)]
pub struct SerialArrayBuilder(PrimitiveArrayBuilder<i64>);

#[derive(Debug, Clone)]
pub struct SerialArray(PrimitiveArray<i64>);
Copy link
Contributor

Choose a reason for hiding this comment

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

What about impl PrimitiveArrayItemType for Serial and then pub type SerialArray = PrimitiveArray<Serial>; (see NaiveDateArray)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, i'll try it.

@shanicky shanicky removed this pull request from the merge queue due to a manual request Mar 6, 2023
Copy link
Contributor

@xiangjinwu xiangjinwu left a comment

Choose a reason for hiding this comment

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

lgtm

@shanicky shanicky added this pull request to the merge queue Mar 7, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 7, 2023
@shanicky shanicky added this pull request to the merge queue Mar 7, 2023
Merged via the queue into main with commit bf83e28 Mar 7, 2023
@shanicky shanicky deleted the peng/serial-1-array branch March 7, 2023 05:49
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.

3 participants