fix: into_iter in the assert_table_eq macro

This makes it so the macro can take `&[String]` or `&[&str]`.
pull/24376/head
Carol (Nichols || Goulding) 2021-01-29 15:58:12 -05:00
parent 39338b195b
commit 8975b1cbf5
2 changed files with 6 additions and 5 deletions

View File

@ -14,7 +14,8 @@ use crate::arrow::compute::kernels::sort::{lexsort, SortColumn, SortOptions};
#[macro_export]
macro_rules! assert_table_eq {
($EXPECTED_LINES: expr, $CHUNKS: expr) => {
let expected_lines: Vec<String> = $EXPECTED_LINES.iter().map(|&s| s.into()).collect();
let expected_lines: Vec<String> =
$EXPECTED_LINES.into_iter().map(|s| s.to_string()).collect();
let formatted = arrow_deps::arrow::util::pretty::pretty_format_batches($CHUNKS).unwrap();

View File

@ -452,14 +452,14 @@ mod tests {
"+-----+------+",
];
let batches = run_query(&db, "select * from cpu").await;
assert_table_eq!(expected, &batches);
assert_table_eq!(&expected, &batches);
// And expect that we still get the same thing when data is rolled over again
let chunk = db.rollover_partition("1970-01-01T00").await.unwrap();
assert_eq!(chunk.id(), 1);
let batches = run_query(&db, "select * from cpu").await;
assert_table_eq!(expected, &batches);
assert_table_eq!(&expected, &batches);
}
#[tokio::test]
@ -495,7 +495,7 @@ mod tests {
"+-----+------+",
];
let batches = run_query(&db, "select * from cpu").await;
assert_table_eq!(expected, &batches);
assert_table_eq!(&expected, &batches);
// now, drop the mutable buffer chunk and results should still be the same
db.drop_mutable_buffer_chunk(partition_key, mb_chunk.id())
@ -506,7 +506,7 @@ mod tests {
assert_eq!(read_buffer_chunk_ids(&db, partition_key).await, vec![0]);
let batches = run_query(&db, "select * from cpu").await;
assert_table_eq!(expected, &batches);
assert_table_eq!(&expected, &batches);
// drop, the chunk from the read buffer
db.drop_read_buffer_chunk(partition_key, mb_chunk.id())