Skip to content

Commit

Permalink
Fix off by one error in dbase::File
Browse files Browse the repository at this point in the history
dbase::File calculated the position of the record/field
assuming the record size by using the header's info
which includes the implicit deletion flag size, and dbase::File
added the deletion flag size again resulting of bad readings.
  • Loading branch information
tmontaigu committed Oct 27, 2023
1 parent 15e99e7 commit 69e1bc8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/datafusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ mod test {
// +-----------------------+
// | Franconia-Springfield |
// | Federal Center SW |
// | "Foggy Bottom GWU" |
// | "Farragut West" |
// | "Federal Triangle" |
// +-----------------------+

// extract first (and only) RecordBatch from dataframe
Expand All @@ -448,7 +451,13 @@ mod test {
// ensure values match
assert_eq!(
result[0].column(0).as_ref(),
&StringArray::from(vec!["Franconia-Springfield", "Federal Center SW"])
&StringArray::from(vec![
"Franconia-Springfield",
"Federal Center SW",
"Foggy Bottom GWU",
"Farragut West",
"Federal Triangle"
])
);
Ok(())
}
Expand Down

0 comments on commit 69e1bc8

Please sign in to comment.