pub struct SampleClause {
pub method: Option<ObjectName>,
pub size: Literal,
pub unit: SampleUnit,
pub seed: Option<Literal>,
pub meta: Meta,
}Expand description
DuckDB’s USING SAMPLE <entry> query-level sample specification (its
tablesample_entry grammar).
DuckDB admits two surface shapes for the entry that are semantically identical, so
they fold to this one canonical shape (the renderer re-derives a
method-first spelling): a count-first <size> [unit] [ '(' method [',' seed] ')' ]
(USING SAMPLE 3, USING SAMPLE 50% (bernoulli)) and a method-first method '(' <size> [unit] ')' [REPEATABLE '(' seed ')'] (USING SAMPLE reservoir(20 PERCENT) REPEATABLE (42)). The size and seed are always numeric literals (DuckDB rejects a
negative or general-expression size), so the node carries no expression and is not
generic over X.
Fields§
§method: Option<ObjectName>The sampling method (reservoir/bernoulli/system), or None for the bare
count form (USING SAMPLE 3). Whether the method led or trailed the count in
source is not preserved — the two orders are equivalent and render method-first.
size: LiteralThe sample size literal (3, 50, 3.5).
unit: SampleUnitThe size unit: a bare count, an explicit ROWS, or a percentage (PERCENT
keyword or the % sign).
seed: Option<Literal>The random seed from REPEATABLE (seed) or the inline (method, seed) form;
None when unwritten.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for SampleClause
impl Clone for SampleClause
Source§fn clone(&self) -> SampleClause
fn clone(&self) -> SampleClause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SampleClause
impl Debug for SampleClause
Source§impl<'de> Deserialize<'de> for SampleClause
impl<'de> Deserialize<'de> for SampleClause
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SampleClause
Source§impl Hash for SampleClause
impl Hash for SampleClause
Source§impl PartialEq for SampleClause
impl PartialEq for SampleClause
Source§impl Render for SampleClause
impl Render for SampleClause
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl Serialize for SampleClause
impl Serialize for SampleClause
impl StructuralPartialEq for SampleClause
Auto Trait Implementations§
impl Freeze for SampleClause
impl RefUnwindSafe for SampleClause
impl Send for SampleClause
impl Sync for SampleClause
impl Unpin for SampleClause
impl UnsafeUnpin for SampleClause
impl UnwindSafe for SampleClause
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.