pub enum PipeOperator {
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>,
},
}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
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