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 more