uqa_execution/relational/
set_operation.rs1use super::{Batch, ExecResult, PhysicalOperator, SetOpKind};
10
11pub struct SetOperation<'a> {
17 inner: crate::set_operation::ExternalSetOperation<'a>,
18}
19
20impl<'a> SetOperation<'a> {
21 pub fn new(
22 left: Box<dyn PhysicalOperator + 'a>,
23 right: Box<dyn PhysicalOperator + 'a>,
24 kind: SetOpKind,
25 all: bool,
26 ) -> ExecResult<Self> {
27 Self::new_with_work_mem(left, right, kind, all, 64 * 1024 * 1024)
28 }
29
30 pub fn new_with_work_mem(
31 left: Box<dyn PhysicalOperator + 'a>,
32 right: Box<dyn PhysicalOperator + 'a>,
33 kind: SetOpKind,
34 all: bool,
35 work_mem_bytes: usize,
36 ) -> ExecResult<Self> {
37 Ok(Self {
38 inner: crate::set_operation::ExternalSetOperation::new(
39 left,
40 right,
41 kind,
42 all,
43 work_mem_bytes,
44 )?,
45 })
46 }
47}
48
49impl PhysicalOperator for SetOperation<'_> {
50 fn row_schema(&self) -> &super::RowSchema {
51 self.inner.row_schema()
52 }
53
54 fn open(&mut self) -> ExecResult<()> {
55 self.inner.open()
56 }
57
58 fn next(&mut self) -> ExecResult<Option<Batch>> {
59 self.inner.next()
60 }
61
62 fn close(&mut self) -> ExecResult<()> {
63 self.inner.close()
64 }
65}
66
67