Struct datafusion_common::UnnestOptions
source · pub struct UnnestOptions {
pub preserve_nulls: bool,
}
Expand description
Options for unnesting a column that contains a list type, replicating values in the other, non nested rows.
Conceptually this operation is like joining each row with all the values in the list column.
If preserve_nulls
is false, nulls and empty lists
from the input column are not carried through to the output. This
is the default behavior for other systems such as ClickHouse and
DuckDB
If preserve_nulls
is true (the default), nulls from the input
column are carried through to the output.
§Examples
§Unnest(c1)
, preserve_nulls: false
┌─────────┐ ┌─────┐ ┌─────────┐ ┌─────┐
│ {1, 2} │ │ A │ Unnest │ 1 │ │ A │
├─────────┤ ├─────┤ ├─────────┤ ├─────┤
│ null │ │ B │ │ 2 │ │ A │
├─────────┤ ├─────┤ ────────────▶ ├─────────┤ ├─────┤
│ {} │ │ D │ │ 3 │ │ E │
├─────────┤ ├─────┤ └─────────┘ └─────┘
│ {3} │ │ E │ c1 c2
└─────────┘ └─────┘
c1 c2
§Unnest(c1)
, preserve_nulls: true
┌─────────┐ ┌─────┐ ┌─────────┐ ┌─────┐
│ {1, 2} │ │ A │ Unnest │ 1 │ │ A │
├─────────┤ ├─────┤ ├─────────┤ ├─────┤
│ null │ │ B │ │ 2 │ │ A │
├─────────┤ ├─────┤ ────────────▶ ├─────────┤ ├─────┤
│ {} │ │ D │ │ null │ │ B │
├─────────┤ ├─────┤ ├─────────┤ ├─────┤
│ {3} │ │ E │ │ 3 │ │ E │
└─────────┘ └─────┘ └─────────┘ └─────┘
c1 c2 c1 c2
Fields§
§preserve_nulls: bool
Should nulls in the input be preserved? Defaults to true
Implementations§
source§impl UnnestOptions
impl UnnestOptions
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new UnnestOptions
with default values
sourcepub fn with_preserve_nulls(self, preserve_nulls: bool) -> Self
pub fn with_preserve_nulls(self, preserve_nulls: bool) -> Self
Set the behavior with nulls in the input as described on
Self
Trait Implementations§
source§impl Clone for UnnestOptions
impl Clone for UnnestOptions
source§fn clone(&self) -> UnnestOptions
fn clone(&self) -> UnnestOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UnnestOptions
impl Debug for UnnestOptions
source§impl Default for UnnestOptions
impl Default for UnnestOptions
source§impl Hash for UnnestOptions
impl Hash for UnnestOptions
source§impl PartialEq for UnnestOptions
impl PartialEq for UnnestOptions
source§impl PartialOrd for UnnestOptions
impl PartialOrd for UnnestOptions
impl Eq for UnnestOptions
impl StructuralPartialEq for UnnestOptions
Auto Trait Implementations§
impl Freeze for UnnestOptions
impl RefUnwindSafe for UnnestOptions
impl Send for UnnestOptions
impl Sync for UnnestOptions
impl Unpin for UnnestOptions
impl UnwindSafe for UnnestOptions
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
Compare self to
key
and return true
if they are equal.