-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Assert chunks are equal after physical cast to prevent OOB (#14873)
- Loading branch information
Showing
6 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[cfg(feature = "parquet")] | ||
mod parquet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use std::io::{Seek, SeekFrom}; | ||
|
||
use polars::prelude::*; | ||
|
||
#[test] | ||
fn test_cast_join_14872() { | ||
let df1 = df![ | ||
"ints" => [1] | ||
] | ||
.unwrap(); | ||
|
||
let mut df2 = df![ | ||
"ints" => [0, 1], | ||
"strings" => vec![Series::new("", ["a"]); 2], | ||
] | ||
.unwrap(); | ||
|
||
let mut buf = std::io::Cursor::new(vec![]); | ||
ParquetWriter::new(&mut buf) | ||
.with_row_group_size(Some(1)) | ||
.finish(&mut df2) | ||
.unwrap(); | ||
|
||
let _ = buf.seek(SeekFrom::Start(0)); | ||
let df2 = ParquetReader::new(buf).finish().unwrap(); | ||
|
||
let out = df1 | ||
.join(&df2, ["ints"], ["ints"], JoinArgs::new(JoinType::Left)) | ||
.unwrap(); | ||
|
||
let expected = df![ | ||
"ints" => [1], | ||
"strings" => vec![Series::new("", ["a"]); 1], | ||
] | ||
.unwrap(); | ||
|
||
assert!(expected.equals(&out)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ mod schema; | |
mod time; | ||
|
||
mod arrow; | ||
mod chunks; | ||
|
||
pub static FOODS_CSV: &str = "../../examples/datasets/foods1.csv"; |