Skip to content

Commit

Permalink
Update columnar exchange function
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Dec 20, 2024
1 parent 904d027 commit 2cf50d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/columnar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fn main() {
let data = data_input.to_stream(scope);
let keys = keys_input.to_stream(scope);

let data_pact = ExchangeCore::<ColumnBuilder<((String,()),u64,i64)>,_>::new_core(|x: &((&str,()),&u64,&i64)| (x.0).0.len() as u64);
let keys_pact = ExchangeCore::<ColumnBuilder<((String,()),u64,i64)>,_>::new_core(|x: &((&str,()),&u64,&i64)| (x.0).0.len() as u64);
let data_pact = ExchangeCore::<ColumnBuilder<((String,()),u64,i64)>,_>::new_core(|x: &((&str,()),&u64,&i64)| (x.0).0.as_bytes().iter().sum::<u8>() as u64);
let keys_pact = ExchangeCore::<ColumnBuilder<((String,()),u64,i64)>,_>::new_core(|x: &((&str,()),&u64,&i64)| (x.0).0.as_bytes().iter().sum::<u8>() as u64);

let data = arrange_core::<_,_,Col2KeyBatcher<_,_,_>, ColKeyBuilder<_,_,_>, ColKeySpine<_,_,_>>(&data, data_pact, "Data");
let keys = arrange_core::<_,_,Col2KeyBatcher<_,_,_>, ColKeyBuilder<_,_,_>, ColKeySpine<_,_,_>>(&keys, keys_pact, "Keys");
Expand Down Expand Up @@ -447,7 +447,9 @@ pub mod batcher {
}
}

self.ready.push_back(std::mem::take(&mut self.empty));
if !self.empty.is_empty() {
self.ready.push_back(std::mem::take(&mut self.empty));
}
}
}
}

0 comments on commit 2cf50d8

Please sign in to comment.