diff --git a/src/query/sql/src/planner/binder/bind_table_reference/bind_table.rs b/src/query/sql/src/planner/binder/bind_table_reference/bind_table.rs index 3d5ea59fbd0bb..93bb3bed0fc0e 100644 --- a/src/query/sql/src/planner/binder/bind_table_reference/bind_table.rs +++ b/src/query/sql/src/planner/binder/bind_table_reference/bind_table.rs @@ -86,11 +86,7 @@ impl Binder { )) .set_span(*span)); } - return if cte_info.materialized - && self.ctx.get_settings().get_enable_materialized_cte()? - { - self.bind_m_cte(bind_context, cte_info, &table_name, alias, span) - } else if cte_info.recursive { + return if cte_info.recursive { if self.bind_recursive_cte { self.bind_r_cte_scan(bind_context, cte_info, &table_name, alias) } else { @@ -123,13 +119,13 @@ impl Binder { let bind_context = parent.unwrap().as_mut(); let cte_map = bind_context.cte_context.cte_map.clone(); if let Some(cte_info) = cte_map.get(&table_name) { - return if cte_info.materialized - && self.ctx.get_settings().get_enable_materialized_cte()? - { - self.bind_m_cte(bind_context, cte_info, &table_name, alias, span) - } else { - self.bind_cte(*span, bind_context, &table_name, alias, cte_info) - }; + return self.bind_cte( + *span, + bind_context, + &table_name, + alias, + cte_info, + ); } parent = bind_context.parent.as_mut(); }