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

chore(relational-table): store zero bytes for sentinel columns #2296

Merged
merged 2 commits into from
May 4, 2022

Conversation

BowenXiao1999
Copy link
Contributor

@BowenXiao1999 BowenXiao1999 commented May 4, 2022

What's changed and what's your intention?

Store zero bytes for sentinel cell value.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

deserialize_datum_from(&DataType::Int64, &mut deserializer).unwrap()
);
// Do not deserialize datum for SENTINEL_CELL_ID cuz the value length is 0.
if deserialize_column_id(&k[k.len() - 4..]).unwrap() != SENTINEL_CELL_ID {
Copy link
Contributor Author

@BowenXiao1999 BowenXiao1999 May 4, 2022

Choose a reason for hiding this comment

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

I'm not sure the optimization is worth. We might need this check every time it's possible to get a sentinel? cc @skyzh

Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, we can use relational table API to get data. All tests should be refactored to use relational table API instead of getting a single k-v pairs.

Here I think a better way is to check if v is empty. Also should use deserialize_cell instead of deserialize_datum.

@BowenXiao1999 BowenXiao1999 linked an issue May 4, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #2296 (e166e93) into main (f2c5758) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2296      +/-   ##
==========================================
- Coverage   71.15%   71.15%   -0.01%     
==========================================
  Files         664      664              
  Lines       83660    83663       +3     
==========================================
+ Hits        59526    59528       +2     
- Misses      24134    24135       +1     
Flag Coverage Δ
rust 71.15% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/common/src/util/ordered/serde.rs 92.92% <100.00%> (+0.03%) ⬆️
src/stream/src/executor/lookup/tests.rs 100.00% <100.00%> (ø)
src/common/src/types/ordered_float.rs 24.10% <0.00%> (-0.20%) ⬇️

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

let value = serialize_cell(&None)?;
result.push((key, Some(value)));
// Store zero bytes for the sentinel value.
result.push((key, Some("".to_string().into_bytes())));
Copy link
Contributor

Choose a reason for hiding this comment

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

b"".to_vec() or vec![].

deserialize_datum_from(&DataType::Int64, &mut deserializer).unwrap()
);
// Do not deserialize datum for SENTINEL_CELL_ID cuz the value length is 0.
if deserialize_column_id(&k[k.len() - 4..]).unwrap() != SENTINEL_CELL_ID {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, we can use relational table API to get data. All tests should be refactored to use relational table API instead of getting a single k-v pairs.

Here I think a better way is to check if v is empty. Also should use deserialize_cell instead of deserialize_datum.

@BowenXiao1999 BowenXiao1999 force-pushed the bw/use-zero-bytes-for-sentiel branch from 5f11ff8 to e166e93 Compare May 4, 2022 08:40
@BowenXiao1999 BowenXiao1999 enabled auto-merge (squash) May 4, 2022 08:40
@BowenXiao1999 BowenXiao1999 merged commit 2304857 into main May 4, 2022
@BowenXiao1999 BowenXiao1999 deleted the bw/use-zero-bytes-for-sentiel branch May 4, 2022 08:56
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.

relational-table: store zero bytes for sentinel columns
2 participants