Transform

Enum Transform 

Source
pub enum Transform {
Show 30 variants Filter { field: String, value: String, }, Select { fields: Vec<String>, }, Sort { field: String, desc: bool, }, Limit { n: usize, }, Count, Sum { field: String, }, Mean { field: String, }, Rate { window: String, }, Percentage, Join { other: String, on: String, }, Sample { n: usize, }, GroupBy { field: String, }, Distinct { field: Option<String>, }, Where { field: String, op: String, value: String, }, Offset { n: usize, }, Min { field: String, }, Max { field: String, }, First { n: usize, }, Last { n: usize, }, Flatten, Reverse, Map { expr: String, }, Reduce { initial: String, expr: String, }, Aggregate { field: String, op: AggregateOp, }, Pivot { row_field: String, col_field: String, value_field: String, }, CumulativeSum { field: String, }, Rank { field: String, method: RankMethod, }, MovingAverage { field: String, window: usize, }, PercentChange { field: String, }, Suggest { prefix: String, count: usize, },
}
Expand description

A transform operation in the expression pipeline.

Variants§

§

Filter

Filter rows: filter(field=value)

Fields

§field: String

Field to filter on

§value: String

Value to match

§

Select

Select columns: select(field1, field2)

Fields

§fields: Vec<String>

Fields to select

§

Sort

Sort rows: sort(field, desc=true)

Fields

§field: String

Field to sort by

§desc: bool

Sort descending

§

Limit

Limit rows: limit(n)

Fields

§n: usize

Maximum number of rows

§

Count

Count rows

§

Sum

Sum a field: sum(field)

Fields

§field: String

Field to sum

§

Mean

Average a field: mean(field)

Fields

§field: String

Field to average

§

Rate

Rate over window: rate(window)

Fields

§window: String

Time window (e.g., “1m”, “5m”)

§

Percentage

Convert to percentage

§

Join

Join with another dataset: join(other, on=field)

Fields

§other: String

Other dataset

§on: String

Join field

§

Sample

Sample rows: sample(n)

Fields

§n: usize

Number of rows to sample

§

GroupBy

Group by field: group_by(field)

Fields

§field: String

Field to group by

§

Distinct

Get distinct values: distinct(field)

Fields

§field: Option<String>

Field to get distinct values from (optional)

§

Where

Advanced filter with operators: where(field, op, value)

Fields

§field: String

Field to filter on

§op: String

Comparison operator (eq, ne, gt, lt, gte, lte, contains)

§value: String

Value to compare

§

Offset

Offset/skip rows: offset(n)

Fields

§n: usize

Number of rows to skip

§

Min

Minimum value: min(field)

Fields

§field: String

Field to find minimum

§

Max

Maximum value: max(field)

Fields

§field: String

Field to find maximum

§

First

First n rows: first(n)

Fields

§n: usize

Number of rows

§

Last

Last n rows: last(n)

Fields

§n: usize

Number of rows

§

Flatten

Flatten nested arrays: flatten

§

Reverse

Reverse order: reverse

§

Map

Map/transform each element: map(expr)

Fields

§expr: String

Expression to apply to each element

§

Reduce

Reduce/fold elements: reduce(initial, accumulator_expr)

Fields

§initial: String

Initial value

§expr: String

Accumulator expression (uses acc and item variables)

§

Aggregate

Aggregate after group_by: agg(field, op)

Fields

§field: String

Field to aggregate

§op: AggregateOp

Aggregation operation (sum, count, mean, min, max)

§

Pivot

Pivot table: pivot(row_field, col_field, value_field)

Fields

§row_field: String

Field for row labels

§col_field: String

Field for column headers

§value_field: String

Field for values

§

CumulativeSum

Running total: cumsum(field)

Fields

§field: String

Field to sum

§

Rank

Rank within group: rank(field, method)

Fields

§field: String

Field to rank by

§method: RankMethod

Ranking method (dense, ordinal, average)

§

MovingAverage

Moving average: moving_avg(field, window)

Fields

§field: String

Field to average

§window: usize

Window size

§

PercentChange

Percent change: pct_change(field)

Fields

§field: String

Field to calculate percent change

§

Suggest

Model suggestion: suggest(prefix, count) - for N-gram/autocomplete models

Fields

§prefix: String

Input prefix to get suggestions for

§count: usize

Maximum number of suggestions to return

Trait Implementations§

Source§

impl Clone for Transform

Source§

fn clone(&self) -> Transform

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transform

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Transform

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Transform

Source§

fn eq(&self, other: &Transform) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Transform

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Transform

Source§

impl StructuralPartialEq for Transform

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,