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

refactor(state_table): simplify interface of insert / delete #3238

Merged
merged 3 commits into from
Jun 15, 2022

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Jun 15, 2022

What's changed and what's your intention?

As title

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)

close #3232

@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #3238 (522d669) into main (bfcdf32) will increase coverage by 0.00%.
The diff coverage is 91.47%.

@@           Coverage Diff           @@
##             main    #3238   +/-   ##
=======================================
  Coverage   73.19%   73.19%           
=======================================
  Files         745      745           
  Lines      101868   101857   -11     
=======================================
- Hits        74563    74556    -7     
+ Misses      27305    27301    -4     
Flag Coverage Δ
rust 73.19% <91.47%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
src/batch/src/executor/row_seq_scan.rs 23.68% <ø> (+0.40%) ⬆️
src/stream/src/executor/mview/materialize.rs 89.28% <ø> (ø)
src/stream/src/from_proto/batch_query.rs 0.00% <0.00%> (ø)
src/storage/src/table/cell_based_table.rs 70.49% <28.57%> (-0.45%) ⬇️
src/storage/src/table/state_table.rs 88.58% <71.42%> (-0.25%) ⬇️
...am/src/executor/managed_state/top_n/top_n_state.rs 93.43% <94.11%> (-0.10%) ⬇️
src/common/src/util/ordered/serde.rs 88.97% <100.00%> (-0.13%) ⬇️
src/storage/src/table/test_relational_table.rs 98.07% <100.00%> (ø)
...am/src/executor/managed_state/aggregation/value.rs 94.30% <100.00%> (ø)
...ecutor/managed_state/top_n/top_n_bottom_n_state.rs 82.70% <100.00%> (ø)
... and 4 more

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

@wcy-fdu wcy-fdu requested a review from lmatz June 15, 2022 06:47
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.

Looks good

@wcy-fdu wcy-fdu merged commit 949ba46 into main Jun 15, 2022
@wcy-fdu wcy-fdu deleted the wcy_simplify_interface branch June 15, 2022 07:10
Comment on lines 194 to 197
match TOP_N_TYPE {
TOP_N_MIN => self.state_table.insert::<false>(value.clone())?,
TOP_N_MAX => self.state_table.insert::<true>(value.clone())?,
TOP_N_MIN => self.state_table.insert(value.clone())?,
TOP_N_MAX => self.state_table.insert(value.clone())?,
_ => unreachable!(),
Copy link
Member

Choose a reason for hiding this comment

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

No need to match here? 😁

Comment on lines -229 to +245
TOP_N_MIN => self.state_table.delete::<false>(value)?,
TOP_N_MAX => self.state_table.delete::<true>(value)?,
TOP_N_MIN => self.state_table.delete(value)?,
TOP_N_MAX => self.state_table.delete(value)?,
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

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.

state_table: simplify interface of insert / delete
3 participants