pub enum StructMode {
ObjectOnly,
ListOnly,
}
Expand description
Specifies what is considered valid JSON when reading or writing RecordBatches or StructArrays.
This enum controls which form(s) the Reader will accept and which form the
Writer will produce. For example, if the RecordBatch Schema is
[("a", Int32), ("r", Struct([("b", Boolean), ("c", Utf8)]))]
then a Reader with StructMode::ObjectOnly
would read rows of the form
{"a": 1, "r": {"b": true, "c": "cat"}}
while with [‘StructMode::ListOnly’]
would read rows of the form [1, [true, "cat"]]
. A Writer would produce
rows formatted similarly.
The list encoding is more compact if the schema is known, and is used by tools such as Presto and Trino.
When reading objects, the order of the key does not matter. When reading lists, the entries must be the same number and in the same order as the struct fields. Map columns are not affected by this option.
Variants§
ObjectOnly
Encode/decode structs as objects (e.g., {“a”: 1, “b”: “c”})
ListOnly
Encode/decode structs as lists (e.g., [1, “c”])
Trait Implementations§
Source§impl Clone for StructMode
impl Clone for StructMode
Source§fn clone(&self) -> StructMode
fn clone(&self) -> StructMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StructMode
impl Debug for StructMode
Source§impl Default for StructMode
impl Default for StructMode
Source§fn default() -> StructMode
fn default() -> StructMode
Source§impl PartialEq for StructMode
impl PartialEq for StructMode
impl Copy for StructMode
impl Eq for StructMode
impl StructuralPartialEq for StructMode
Auto Trait Implementations§
impl Freeze for StructMode
impl RefUnwindSafe for StructMode
impl Send for StructMode
impl Sync for StructMode
impl Unpin for StructMode
impl UnwindSafe for StructMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.