diff --git a/src/query/sql/src/planner/binder/bind_query/bind.rs b/src/query/sql/src/planner/binder/bind_query/bind.rs index b4f7c45ef4a0b..a010dd097ccd9 100644 --- a/src/query/sql/src/planner/binder/bind_query/bind.rs +++ b/src/query/sql/src/planner/binder/bind_query/bind.rs @@ -178,7 +178,9 @@ impl Binder { } fn m_cte_to_temp_table(&self, cte: &CTE) -> Result<()> { - let engine = if self.ctx.get_settings().get_persist_materialized_cte()? { + let engine = if self.ctx.get_settings().get_persist_materialized_cte()? + || !self.ctx.get_cluster().is_empty() + { Engine::Fuse } else { Engine::Memory