Skip to content

Commit

Permalink
Fix lz4 encoded float
Browse files Browse the repository at this point in the history
  • Loading branch information
cswinter committed May 1, 2024
1 parent 0f1c333 commit 9bbcfc0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mem_store/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ impl DataSection {
lz4::decode::<i64>(&mut lz4::decoder(encoded), &mut decoded);
DataSection::I64(decoded)
}
EncodingType::F64 => {
let mut decoded = vec![OrderedFloat(0.0); len];
lz4::decode::<OrderedFloat<f64>>(&mut lz4::decoder(encoded), &mut decoded);
DataSection::F64(decoded)
}
t => panic!("Unexpected type {:?} for lz4 decode", t),
},
DataSection::LZ4 {
Expand Down
9 changes: 9 additions & 0 deletions tests/query_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1630,3 +1630,12 @@ fn test_float_greater_than() {
&[vec![Int(0), Float(0.123412)], vec![Int(1), Float(0.0003)]],
);
}


// #[test]
// fn test_missing_count() {
// test_query_ec(
// "SELECT COUNT(0) AS count FROM _meta_tables WHERE \"name\" = 'geistesblitz_dashboard'",
// &[vec![Int(0)]],
// );
// }

0 comments on commit 9bbcfc0

Please sign in to comment.