Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Feb 25, 2024
1 parent e975d9b commit e270fb6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 49 deletions.
32 changes: 31 additions & 1 deletion core/src/execution/datafusion/shuffle_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,4 +1282,34 @@ impl RecordBatchStream for EmptyStream {
}

#[cfg(test)]
mod shuffle_writer_test;
mod test {
use super::*;

#[test]
fn test_slot_size() {
let batch_size = 1usize;
// not inclusive of all supported types, but enough to test the function
let supported_primitive_types = [
DataType::Int32,
DataType::Int64,
DataType::UInt32,
DataType::UInt64,
DataType::Float32,
DataType::Float64,
DataType::Boolean,
DataType::Utf8,
DataType::LargeUtf8,
DataType::Binary,
DataType::LargeBinary,
DataType::FixedSizeBinary(16),
];
let expected_slot_size = [4, 8, 4, 8, 4, 8, 1, 104, 108, 104, 108, 16];
supported_primitive_types
.iter()
.zip(expected_slot_size.iter())
.for_each(|(data_type, expected)| {
let slot_size = slot_size(batch_size, data_type);
assert_eq!(slot_size, *expected);
})
}
}

This file was deleted.

0 comments on commit e270fb6

Please sign in to comment.