pub enum PipeOperator {
Show 18 variants
Limit {
expr: Expr,
offset: Option<Expr>,
},
Where {
expr: Expr,
},
OrderBy {
exprs: Vec<OrderByExpr>,
},
Select {
exprs: Vec<SelectItem>,
},
Extend {
exprs: Vec<SelectItem>,
},
Set {
assignments: Vec<Assignment>,
},
Drop {
columns: Vec<Ident>,
},
As {
alias: Ident,
},
Aggregate {
full_table_exprs: Vec<ExprWithAliasAndOrderBy>,
group_by_expr: Vec<ExprWithAliasAndOrderBy>,
},
TableSample {
sample: Box<TableSample>,
},
Rename {
mappings: Vec<IdentWithAlias>,
},
Union {
set_quantifier: SetQuantifier,
queries: Vec<Query>,
},
Intersect {
set_quantifier: SetQuantifier,
queries: Vec<Query>,
},
Except {
set_quantifier: SetQuantifier,
queries: Vec<Query>,
},
Call {
function: Function,
alias: Option<Ident>,
},
Pivot {
aggregate_functions: Vec<ExprWithAlias>,
value_column: Vec<Ident>,
value_source: PivotValueSource,
alias: Option<Ident>,
},
Unpivot {
value_column: Ident,
name_column: Ident,
unpivot_columns: Vec<Ident>,
alias: Option<Ident>,
},
Join(Join),
}
Expand description
Pipe syntax, first introduced in Google BigQuery. Example:
FROM Produce
|> WHERE sales > 0
|> AGGREGATE SUM(sales) AS total_sales, COUNT(*) AS num_sales
GROUP BY item;
See https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#pipe_syntax
Variants§
Limit
Limits the number of rows to return in a query, with an optional OFFSET clause to skip over rows.
Syntax: |> LIMIT <n> [OFFSET <m>]
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#limit_pipe_operator
Where
Filters the results of the input table.
Syntax: |> WHERE <condition>
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#where_pipe_operator
OrderBy
ORDER BY <expr> [ASC|DESC], ...
Fields
exprs: Vec<OrderByExpr>
Select
Produces a new table with the listed columns, similar to the outermost SELECT clause in a table subquery in standard syntax.
Syntax |> SELECT <expr> [[AS] alias], ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#select_pipe_operator
Fields
exprs: Vec<SelectItem>
Extend
Propagates the existing table and adds computed columns, similar to SELECT *, new_column in standard syntax.
Syntax: |> EXTEND <expr> [[AS] alias], ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#extend_pipe_operator
Fields
exprs: Vec<SelectItem>
Set
Replaces the value of a column in the current table, similar to SELECT * REPLACE (expression AS column) in standard syntax.
Syntax: |> SET <column> = <expression>, ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#set_pipe_operator
Fields
assignments: Vec<Assignment>
Drop
Removes listed columns from the current table, similar to SELECT * EXCEPT (column) in standard syntax.
Syntax: |> DROP <column>, ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#drop_pipe_operator
As
Introduces a table alias for the input table, similar to applying the AS alias clause on a table subquery in standard syntax.
Syntax: |> AS <alias>
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#as_pipe_operator
Aggregate
Performs aggregation on data across grouped rows or an entire table.
Syntax: |> AGGREGATE <agg_expr> [[AS] alias], ...
Syntax:
|> AGGREGATE [<agg_expr> [[AS] alias], ...]
GROUP BY <grouping_expr> [AS alias], ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#aggregate_pipe_operator
TableSample
Selects a random sample of rows from the input table. Syntax: `|> TABLESAMPLE SYSTEM (10 PERCENT) See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#tablesample_pipe_operator
Fields
sample: Box<TableSample>
Rename
Renames columns in the input table.
Syntax: |> RENAME old_name AS new_name, ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#rename_pipe_operator
Fields
mappings: Vec<IdentWithAlias>
Union
Combines the input table with one or more tables using UNION.
Syntax: |> UNION [ALL|DISTINCT] (<query>), (<query>), ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#union_pipe_operator
Intersect
Returns only the rows that are present in both the input table and the specified tables.
Syntax: |> INTERSECT [DISTINCT] (<query>), (<query>), ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#intersect_pipe_operator
Except
Returns only the rows that are present in the input table but not in the specified tables.
Syntax: |> EXCEPT DISTINCT (<query>), (<query>), ...
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#except_pipe_operator
Call
Calls a table function or procedure that returns a table.
Syntax: |> CALL function_name(args) [AS alias]
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#call_pipe_operator
Pivot
Pivots data from rows to columns.
Syntax: |> PIVOT(aggregate_function(column) FOR pivot_column IN (value1, value2, ...)) [AS alias]
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#pivot_pipe_operator
Unpivot
The UNPIVOT
pipe operator transforms columns into rows.
Syntax:
|> UNPIVOT(value_column FOR name_column IN (column1, column2, ...)) [alias]
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#unpivot_pipe_operator
Join(Join)
Joins the input table with another table.
Syntax: |> [JOIN_TYPE] JOIN <table> [alias] ON <condition>
or |> [JOIN_TYPE] JOIN <table> [alias] USING (<columns>)
See more at https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#join_pipe_operator
Trait Implementations§
Source§impl Clone for PipeOperator
impl Clone for PipeOperator
Source§fn clone(&self) -> PipeOperator
fn clone(&self) -> PipeOperator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PipeOperator
impl Debug for PipeOperator
Source§impl Display for PipeOperator
impl Display for PipeOperator
Source§impl Hash for PipeOperator
impl Hash for PipeOperator
Source§impl Ord for PipeOperator
impl Ord for PipeOperator
Source§fn cmp(&self, other: &PipeOperator) -> Ordering
fn cmp(&self, other: &PipeOperator) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PipeOperator
impl PartialEq for PipeOperator
Source§impl PartialOrd for PipeOperator
impl PartialOrd for PipeOperator
Source§impl Visit for PipeOperator
impl Visit for PipeOperator
Source§impl VisitMut for PipeOperator
impl VisitMut for PipeOperator
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
impl Eq for PipeOperator
impl StructuralPartialEq for PipeOperator
Auto Trait Implementations§
impl Freeze for PipeOperator
impl RefUnwindSafe for PipeOperator
impl Send for PipeOperator
impl Sync for PipeOperator
impl Unpin for PipeOperator
impl UnwindSafe for PipeOperator
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.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> Comparable<K> for Q
impl<Q, K> Comparable<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.