Skip to content

Commit

Permalink
Final version
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Dec 10, 2024
1 parent 12c6e8c commit 1acf7bd
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions ipa-core/src/test_fixture/hybrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,7 @@ pub fn hybrid_in_the_clear<I: IntoIterator<Item: Borrow<TestHybridRecord>>>(
max_breakdown: usize,
) -> Vec<u32> {
let mut attributed_conversions = HashMap::<u64, MatchEntry>::new();
for (cnt, input) in input_rows.into_iter().enumerate() {
if cnt % 1_000_000 == 0 {
tracing::info!(
"processed another 1M rows: {}, size of conversions: {}",
cnt / 1_000_000,
attributed_conversions.len()
);
}
for input in input_rows {
match input.borrow() {
r @ (TestHybridRecord::TestConversion { match_key, .. }
| TestHybridRecord::TestImpression { match_key, .. }) => {
Expand All @@ -274,15 +267,8 @@ pub fn hybrid_in_the_clear<I: IntoIterator<Item: Borrow<TestHybridRecord>>>(
}
}
}
tracing::info!("done attribution phase");

// let pairs = attributed_conversions
// .into_values()
// .filter_map(MatchEntry::into_breakdown_key_and_value_tuple)
// .collect::<Vec<_>>();

let mut output = vec![0; max_breakdown];
// for (breakdown_key, value) in attributed_conversions.into_values() {
for entry in attributed_conversions.into_values() {
if let Some((breakdown_key, value)) = entry.into_breakdown_key_and_value_tuple() {
output[usize::try_from(breakdown_key).unwrap()] += value;
Expand Down

0 comments on commit 1acf7bd

Please sign in to comment.