This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc91dd8
commit b9aa8e8
Showing
5 changed files
with
52 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use arrow2::error::Result; | ||
|
||
use super::{integration_read, integration_write}; | ||
use crate::io::ipc::read_gzip_json; | ||
|
||
fn test_file(version: &str, file_name: &str) -> Result<()> { | ||
let (schema, _, batches) = read_gzip_json(version, file_name)?; | ||
|
||
// empty batches are not written/read from parquet and can be ignored | ||
let batches = batches | ||
.into_iter() | ||
.filter(|x| !x.is_empty()) | ||
.collect::<Vec<_>>(); | ||
|
||
let data = integration_write(&schema, &batches)?; | ||
|
||
let (read_schema, read_batches) = integration_read(&data)?; | ||
|
||
assert_eq!(schema, read_schema); | ||
assert_eq!(batches, read_batches); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn roundtrip_100_primitive() -> Result<()> { | ||
test_file("1.0.0-littleendian", "generated_primitive")?; | ||
test_file("1.0.0-bigendian", "generated_primitive") | ||
} | ||
|
||
#[test] | ||
fn roundtrip_100_dict() -> Result<()> { | ||
test_file("1.0.0-littleendian", "generated_dictionary")?; | ||
test_file("1.0.0-bigendian", "generated_dictionary") | ||
} | ||
|
||
#[test] | ||
fn roundtrip_100_extension() -> Result<()> { | ||
test_file("1.0.0-littleendian", "generated_extension")?; | ||
test_file("1.0.0-bigendian", "generated_extension") | ||
} |
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