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

fix(streaming): inappropriate serialization for JoinRow #2398

Merged
merged 1 commit into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/stream/src/executor/managed_state/join/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod join_entry_state;
use std::ops::{Deref, DerefMut, Index};
use std::sync::Arc;

use bytes::Buf;
use bytes::{Buf, BufMut};
use itertools::Itertools;
pub use join_entry_state::JoinEntryState;
use risingwave_common::array::Row;
Expand All @@ -26,7 +26,6 @@ use risingwave_common::hash::{HashKey, PrecomputedBuildHasher};
use risingwave_common::types::{DataType, Datum};
use risingwave_common::util::value_encoding::{deserialize_cell, serialize_cell};
use risingwave_storage::{Keyspace, StateStore};
use serde::Serialize;

/// This is a row with a match degree
#[derive(Clone, Debug)]
Expand Down Expand Up @@ -75,11 +74,12 @@ impl JoinRow {
for v in &self.row.0 {
vec.extend_from_slice(&serialize_cell(v)?)
}
let mut serializer = memcomparable::Serializer::new(vec![]);

// Serialize degree.
self.degree.serialize(&mut serializer)?;
vec.extend_from_slice(&serializer.into_inner());
let mut degree_buf: Vec<u8> = vec![];
degree_buf.put_u64_le(self.degree);
vec.extend_from_slice(&degree_buf);
Copy link
Contributor

Choose a reason for hiding this comment

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

vec.extend_from_slice(&self.degree.to_le_bytes()) should be enough?

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

Emmm didnt notice the auto merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah sorry, will fix those later.


Ok(vec)
}
}
Expand Down