Skip to content

Commit 53f4218

Browse files
committed
fix
1 parent 046685e commit 53f4218

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/query/service/src/interpreters/interpreter_append.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ impl Interpreter for AppendInterpreter {
179179
}
180180

181181
fn inject_result(&self) -> Result<SendableDataBlockStream> {
182-
let append: Append = self.s_expr.plan().clone().try_into()?;
182+
let append: Append = match &self.s_expr.plan() {
183+
RelOperator::Append(append) => append.clone(),
184+
RelOperator::Exchange(_) => self.s_expr.child(0).unwrap().plan().clone().try_into()?,
185+
_ => unreachable!(),
186+
};
183187
match &append.append_type {
184188
AppendType::CopyInto => {
185189
let blocks = self.get_copy_into_table_result()?;

src/query/sql/src/planner/optimizer/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ pub fn contains_local_table_scan(s_expr: &SExpr, metadata: &MetadataRef) -> bool
2727
false
2828
}
2929
|| matches!(s_expr.plan(), RelOperator::RecursiveCteScan { .. })
30+
|| matches!(s_expr.plan(), RelOperator::ValueScan { .. })
3031
}

src/query/sql/src/planner/plans/value_scan.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ use crate::executor::physical_plans::PhysicalValueScan;
1919
use crate::executor::physical_plans::Values;
2020
use crate::executor::PhysicalPlan;
2121
use crate::executor::PhysicalPlanBuilder;
22+
use crate::optimizer::Distribution;
23+
use crate::optimizer::PhysicalProperty;
24+
use crate::optimizer::RelExpr;
2225
use crate::plans::Operator;
2326
use crate::plans::RelOp;
2427

@@ -42,6 +45,12 @@ impl Operator for ValueScan {
4245
fn arity(&self) -> usize {
4346
0
4447
}
48+
49+
fn derive_physical_prop(&self, _rel_expr: &RelExpr) -> Result<PhysicalProperty> {
50+
Ok(PhysicalProperty {
51+
distribution: Distribution::Random,
52+
})
53+
}
4554
}
4655

4756
impl PhysicalPlanBuilder {

0 commit comments

Comments
 (0)