Skip to content

Commit

Permalink
change interface to use vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Rance committed Oct 2, 2023
1 parent 7d4f128 commit 8cd0a4e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions parquet_derive_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mod tests {
borrowed_maybe_borrowed_byte_vec: &borrowed_maybe_borrowed_byte_vec,
}];

let generated_schema = drs.as_slice().schema().unwrap();
let generated_schema = drs.schema().unwrap();

assert_eq!(&schema, &generated_schema);

Expand All @@ -159,7 +159,7 @@ mod tests {
SerializedFileWriter::new(file, generated_schema, props).unwrap();

let mut row_group = writer.next_row_group().unwrap();
drs.as_slice().write_to_row_group(&mut row_group).unwrap();
drs.write_to_row_group(&mut row_group).unwrap();
row_group.close().unwrap();
writer.close().unwrap();
}
Expand Down Expand Up @@ -200,24 +200,22 @@ mod tests {
reader::FileReader, serialized_reader::SerializedFileReader,
};

let generated_schema = drs.as_slice().schema().unwrap();
let generated_schema = drs.schema().unwrap();

let props = Default::default();
let mut writer =
SerializedFileWriter::new(file.try_clone().unwrap(), generated_schema, props)
.unwrap();

let mut row_group = writer.next_row_group().unwrap();
drs.as_slice().write_to_row_group(&mut row_group).unwrap();
drs.write_to_row_group(&mut row_group).unwrap();
row_group.close().unwrap();
writer.close().unwrap();

let reader = SerializedFileReader::new(file).unwrap();

let mut row_group = reader.get_row_group(0).unwrap();
out.as_mut_slice()
.read_from_row_group(&mut *row_group, 2)
.unwrap();
out.read_from_row_group(&mut *row_group, 2).unwrap();

// correct for rounding error when writing milliseconds
drs[0].now = chrono::naive::NaiveDateTime::from_timestamp_millis(
Expand Down

0 comments on commit 8cd0a4e

Please sign in to comment.