Skip to content

Commit

Permalink
add test for reading small batches
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Mar 15, 2019
1 parent 549c829 commit 3158529
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions rust/datafusion/src/datasource/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,25 @@ mod tests {
};
use std::env;

#[test]
fn read_small_batches() {
let table = load_table("alltypes_plain.parquet");

let projection = None;
let scan = table.scan(&projection, 2).unwrap();
let mut it = scan[0].lock().unwrap();

let mut count = 0;
while let Some(batch) = it.next().unwrap() {
assert_eq!(11, batch.num_columns());
assert_eq!(2, batch.num_rows());
count += 1;
}

// we should have seen 4 batches of 2 rows
assert_eq!(4, count);
}

#[test]
fn read_alltypes_plain_parquet() {
let table = load_table("alltypes_plain.parquet");
Expand Down

0 comments on commit 3158529

Please sign in to comment.