(
&self,
op: SetOperator,
left_plan: LogicalPlan,
right_plan: LogicalPlan,
set_quantifier: SetQuantifier,
)
| 132 | } |
| 133 | |
| 134 | pub(super) fn set_operation_to_plan( |
| 135 | &self, |
| 136 | op: SetOperator, |
| 137 | left_plan: LogicalPlan, |
| 138 | right_plan: LogicalPlan, |
| 139 | set_quantifier: SetQuantifier, |
| 140 | ) -> Result<LogicalPlan> { |
| 141 | match (op, set_quantifier) { |
| 142 | (SetOperator::Union, SetQuantifier::All) => { |
| 143 | LogicalPlanBuilder::from(left_plan) |
| 144 | .union(right_plan)? |
| 145 | .build() |
| 146 | } |
| 147 | (SetOperator::Union, SetQuantifier::AllByName) => { |
| 148 | LogicalPlanBuilder::from(left_plan) |
| 149 | .union_by_name(right_plan)? |
| 150 | .build() |
| 151 | } |
| 152 | (SetOperator::Union, SetQuantifier::Distinct | SetQuantifier::None) => { |
| 153 | LogicalPlanBuilder::from(left_plan) |
| 154 | .union_distinct(right_plan)? |
| 155 | .build() |
| 156 | } |
| 157 | ( |
| 158 | SetOperator::Union, |
| 159 | SetQuantifier::ByName | SetQuantifier::DistinctByName, |
| 160 | ) => LogicalPlanBuilder::from(left_plan) |
| 161 | .union_by_name_distinct(right_plan)? |
| 162 | .build(), |
| 163 | (SetOperator::Intersect, SetQuantifier::All) => { |
| 164 | LogicalPlanBuilder::intersect(left_plan, right_plan, true) |
| 165 | } |
| 166 | (SetOperator::Intersect, SetQuantifier::Distinct | SetQuantifier::None) => { |
| 167 | LogicalPlanBuilder::intersect(left_plan, right_plan, false) |
| 168 | } |
| 169 | (SetOperator::Except, SetQuantifier::All) => { |
| 170 | LogicalPlanBuilder::except(left_plan, right_plan, true) |
| 171 | } |
| 172 | (SetOperator::Except, SetQuantifier::Distinct | SetQuantifier::None) => { |
| 173 | LogicalPlanBuilder::except(left_plan, right_plan, false) |
| 174 | } |
| 175 | (op, quantifier) => { |
| 176 | not_impl_err!("{op} {quantifier} not implemented") |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | } |
no test coverage detected