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
Fields
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>The ordering expressions.
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>The select items to produce.
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>Expressions defining added columns.
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>Assignments to apply (column = expr).
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
Fields
full_table_exprs: Vec<ExprWithAliasAndOrderBy>Expressions computed for each row prior to grouping.
group_by_expr: Vec<ExprWithAliasAndOrderBy>Grouping expressions for aggregation.
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>Sampling clause describing the sample.
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>Mappings of old to new identifiers.
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
Fields
set_quantifier: SetQuantifierSet quantifier (ALL or DISTINCT).
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
Fields
set_quantifier: SetQuantifierSet quantifier for the INTERSECT 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
Fields
set_quantifier: SetQuantifierSet quantifier for the EXCEPT 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
Fields
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
Fields
aggregate_functions: Vec<ExprWithAlias>Aggregate functions to compute during pivot.
value_source: PivotValueSourceThe source of pivot values (literal list or subquery).
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
Fields
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
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
VisitorMut. Read more