pub struct Distinct<'a> { /* private fields */ }Expand description
Stable SQL duplicate elimination.
With no key expressions, the complete positional output row is the key.
With expressions, the operator implements DISTINCT ON: it preserves the
first row for each evaluated key in child order.
Implementations§
Source§impl<'a> Distinct<'a>
impl<'a> Distinct<'a>
Sourcepub fn all(child: Box<dyn PhysicalOperator + 'a>) -> Self
pub fn all(child: Box<dyn PhysicalOperator + 'a>) -> Self
Construct a bounded full-row DISTINCT with the compatibility default
work-memory budget.
Sourcepub fn all_with_work_mem(
child: Box<dyn PhysicalOperator + 'a>,
work_mem_bytes: usize,
) -> Self
pub fn all_with_work_mem( child: Box<dyn PhysicalOperator + 'a>, work_mem_bytes: usize, ) -> Self
Construct a bounded full-row DISTINCT with an explicit byte budget.
Sourcepub fn on(
child: Box<dyn PhysicalOperator + 'a>,
keys: Vec<ScalarExpr>,
evaluator: SharedExpressionEvaluator<'a>,
) -> Self
pub fn on( child: Box<dyn PhysicalOperator + 'a>, keys: Vec<ScalarExpr>, evaluator: SharedExpressionEvaluator<'a>, ) -> Self
Construct a bounded DISTINCT ON with the compatibility default
work-memory budget.
Sourcepub fn on_with_work_mem(
child: Box<dyn PhysicalOperator + 'a>,
keys: Vec<ScalarExpr>,
evaluator: SharedExpressionEvaluator<'a>,
work_mem_bytes: usize,
) -> Self
pub fn on_with_work_mem( child: Box<dyn PhysicalOperator + 'a>, keys: Vec<ScalarExpr>, evaluator: SharedExpressionEvaluator<'a>, work_mem_bytes: usize, ) -> Self
Construct a bounded DISTINCT ON with an explicit byte budget.
Sourcepub fn with_spill_directory(self, directory: impl Into<PathBuf>) -> Self
pub fn with_spill_directory(self, directory: impl Into<PathBuf>) -> Self
Place the exact-set files in a caller-selected temporary-data directory. The directory must already exist; a private child directory is created lazily on the first spill and removed through RAII.
Sourcepub fn has_spilled(&self) -> bool
pub fn has_spilled(&self) -> bool
Whether this invocation has migrated its key set to disk.
Sourcepub fn in_memory_key_bytes(&self) -> usize
pub fn in_memory_key_bytes(&self) -> usize
Exact encoded key bytes retained by the in-memory set.
Sourcepub fn spill_path(&self) -> Option<&Path>
pub fn spill_path(&self) -> Option<&Path>
Live private spill directory, for diagnostics and cleanup tests.
Trait Implementations§
Source§impl PhysicalOperator for Distinct<'_>
impl PhysicalOperator for Distinct<'_>
Source§fn row_schema(&self) -> &RowSchema
fn row_schema(&self) -> &RowSchema
Batch returned by Self::next must carry this exact schema; operators must reject a child that violates that invariant.fn open(&mut self) -> ExecResult<()>
fn next(&mut self) -> ExecResult<Option<Batch>>
fn close(&mut self) -> ExecResult<()>
Source§fn estimated_cardinality(&self) -> Option<u64>
fn estimated_cardinality(&self) -> Option<u64>
None means the operator cannot provide a useful estimate. The value
is advisory rather than a correctness bound.Source§fn output_ordering(&self) -> &[PhysicalOrder]
fn output_ordering(&self) -> &[PhysicalOrder]
Source§fn consume_into_aggregate(
&mut self,
_executor: &mut dyn AggregateExecutor,
) -> ExecResult<bool>
fn consume_into_aggregate( &mut self, _executor: &mut dyn AggregateExecutor, ) -> ExecResult<bool>
false promises that no input was
consumed, so the caller can fall back to ordinary Batch pulls.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Distinct<'a>
impl<'a> !Sync for Distinct<'a>
impl<'a> !UnwindSafe for Distinct<'a>
impl<'a> Freeze for Distinct<'a>
impl<'a> Send for Distinct<'a>
impl<'a> Unpin for Distinct<'a>
impl<'a> UnsafeUnpin for Distinct<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more