pub struct JsonArray { /* private fields */ }Expand description
A specialized array for JSON data stored as JSONB binary format
Implementations§
Source§impl JsonArray
impl JsonArray
Sourcepub fn try_from_iter<I, S>(iter: I) -> Result<Self, ArrowError>
pub fn try_from_iter<I, S>(iter: I) -> Result<Self, ArrowError>
Create a new JsonArray from an iterator of JSON strings
Sourcepub fn into_inner(self) -> LargeBinaryArray
pub fn into_inner(self) -> LargeBinaryArray
Get the underlying LargeBinaryArray
Sourcepub fn inner(&self) -> &LargeBinaryArray
pub fn inner(&self) -> &LargeBinaryArray
Get a reference to the underlying LargeBinaryArray
Sourcepub fn value(&self, i: usize) -> Result<String, ArrowError>
pub fn value(&self, i: usize) -> Result<String, ArrowError>
Get the value at index i as decoded JSON string
Sourcepub fn value_bytes(&self, i: usize) -> &[u8] ⓘ
pub fn value_bytes(&self, i: usize) -> &[u8] ⓘ
Get the value at index i as raw JSONB bytes
Sourcepub fn json_path(
&self,
i: usize,
path: &str,
) -> Result<Option<String>, ArrowError>
pub fn json_path( &self, i: usize, path: &str, ) -> Result<Option<String>, ArrowError>
Get JSONPath value from the JSON at index i
Sourcepub fn to_arrow_json(&self) -> Result<ArrayRef, ArrowError>
pub fn to_arrow_json(&self) -> Result<ArrayRef, ArrowError>
Convert to Arrow string array (JSON as UTF-8)
Trait Implementations§
Source§impl Array for JsonArray
impl Array for JsonArray
Source§fn slice(&self, offset: usize, length: usize) -> ArrayRef
fn slice(&self, offset: usize, length: usize) -> ArrayRef
Returns a zero-copy slice of this array with the indicated offset and length. Read more
Source§fn offset(&self) -> usize
fn offset(&self) -> usize
Returns the offset into the underlying data used by this array(-slice).
Note that the underlying data can be shared by many arrays.
This defaults to
0. Read moreSource§fn nulls(&self) -> Option<&NullBuffer>
fn nulls(&self) -> Option<&NullBuffer>
Returns the null buffer of this array if any. Read more
Source§fn get_buffer_memory_size(&self) -> usize
fn get_buffer_memory_size(&self) -> usize
Returns the total number of bytes of memory pointed to by this array.
The buffers store bytes in the Arrow memory format, and include the data as well as the validity map.
Note that this does not always correspond to the exact memory usage of an array,
since multiple arrays can share the same buffers or slices thereof.
Source§fn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Returns the total number of bytes of memory occupied physically by this array.
This value will always be greater than returned by
get_buffer_memory_size() and
includes the overhead of the data structures that contain the pointers to the various buffers.Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrinks the capacity of any exclusively owned buffer as much as possible Read more
Source§fn logical_nulls(&self) -> Option<NullBuffer>
fn logical_nulls(&self) -> Option<NullBuffer>
Returns a potentially computed
NullBuffer that represents the logical
null values of this array, if any. Read moreSource§fn null_count(&self) -> usize
fn null_count(&self) -> usize
Returns the total number of physical null values in this array. Read more
Source§fn logical_null_count(&self) -> usize
fn logical_null_count(&self) -> usize
Returns the total number of logical null values in this array. Read more
Source§fn is_nullable(&self) -> bool
fn is_nullable(&self) -> bool
Returns
false if the array is guaranteed to not contain any logical nulls Read moreSource§impl TryFrom<&GenericByteArray<GenericStringType<i32>>> for JsonArray
impl TryFrom<&GenericByteArray<GenericStringType<i32>>> for JsonArray
Source§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
Source§impl TryFrom<&GenericByteArray<GenericStringType<i64>>> for JsonArray
impl TryFrom<&GenericByteArray<GenericStringType<i64>>> for JsonArray
Source§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
Source§impl TryFrom<GenericByteArray<GenericStringType<i32>>> for JsonArray
impl TryFrom<GenericByteArray<GenericStringType<i32>>> for JsonArray
Source§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
Source§impl TryFrom<GenericByteArray<GenericStringType<i64>>> for JsonArray
impl TryFrom<GenericByteArray<GenericStringType<i64>>> for JsonArray
Source§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for JsonArray
impl RefUnwindSafe for JsonArray
impl Send for JsonArray
impl Sync for JsonArray
impl Unpin for JsonArray
impl UnwindSafe for JsonArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more