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 224
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
0311e22
commit 541c50e
Showing
23 changed files
with
457 additions
and
209 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
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
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 |
---|---|---|
@@ -1,16 +1,30 @@ | ||
use std::collections::VecDeque; | ||
|
||
use crate::{array::NullArray, datatypes::DataType}; | ||
use crate::{ | ||
array::NullArray, | ||
datatypes::DataType, | ||
error::{ArrowError, Result}, | ||
}; | ||
|
||
use super::super::deserialize::Node; | ||
|
||
pub fn read_null(field_nodes: &mut VecDeque<Node>, data_type: DataType) -> NullArray { | ||
NullArray::from_data( | ||
pub fn read_null(field_nodes: &mut VecDeque<Node>, data_type: DataType) -> Result<NullArray> { | ||
let field_node = field_nodes.pop_front().ok_or_else(|| { | ||
ArrowError::oos(format!( | ||
"IPC: unable to fetch the field for {:?}. The file or stream is corrupted.", | ||
data_type | ||
)) | ||
})?; | ||
|
||
Ok(NullArray::from_data( | ||
data_type, | ||
field_nodes.pop_front().unwrap().length() as usize, | ||
) | ||
field_node.length() as usize, | ||
)) | ||
} | ||
|
||
pub fn skip_null(field_nodes: &mut VecDeque<Node>) { | ||
let _ = field_nodes.pop_front(); | ||
pub fn skip_null(field_nodes: &mut VecDeque<Node>) -> Result<()> { | ||
let _ = field_nodes.pop_front().ok_or_else(|| { | ||
ArrowError::oos("IPC: unable to fetch the field for null. The file or stream is corrupted.") | ||
})?; | ||
Ok(()) | ||
} |
Oops, something went wrong.