pub struct Union {Show 17 fields
pub left: Expression,
pub right: Expression,
pub all: bool,
pub distinct: bool,
pub with: Option<With>,
pub order_by: Option<OrderBy>,
pub limit: Option<Box<Expression>>,
pub offset: Option<Box<Expression>>,
pub distribute_by: Option<DistributeBy>,
pub sort_by: Option<SortBy>,
pub cluster_by: Option<ClusterBy>,
pub by_name: bool,
pub side: Option<String>,
pub kind: Option<String>,
pub corresponding: bool,
pub strict: bool,
pub on_columns: Vec<Expression>,
}Expand description
Represent a UNION set operation between two query expressions.
When all is true, duplicate rows are preserved (UNION ALL).
ORDER BY, LIMIT, and OFFSET can be applied to the combined result.
Supports DuckDB’s BY NAME modifier and BigQuery’s CORRESPONDING modifier.
Fields§
§left: ExpressionThe left-hand query operand.
right: ExpressionThe right-hand query operand.
all: boolWhether UNION ALL (true) or UNION (false, which deduplicates).
distinct: boolWhether DISTINCT was explicitly specified
with: Option<With>Optional WITH clause
order_by: Option<OrderBy>ORDER BY applied to entire UNION result
limit: Option<Box<Expression>>LIMIT applied to entire UNION result
offset: Option<Box<Expression>>OFFSET applied to entire UNION result
distribute_by: Option<DistributeBy>DISTRIBUTE BY clause (Hive/Spark)
sort_by: Option<SortBy>SORT BY clause (Hive/Spark)
cluster_by: Option<ClusterBy>CLUSTER BY clause (Hive/Spark)
by_name: boolDuckDB BY NAME modifier
side: Option<String>BigQuery: Set operation side (LEFT, RIGHT, FULL)
kind: Option<String>BigQuery: Set operation kind (INNER)
corresponding: boolBigQuery: CORRESPONDING modifier
strict: boolBigQuery: STRICT modifier (before CORRESPONDING)
on_columns: Vec<Expression>BigQuery: BY (columns) after CORRESPONDING