From 26c8e1f63ce9aaaa6f84a557cf35de4ec9a48e14 Mon Sep 17 00:00:00 2001 From: Shanicky Chen Date: Tue, 12 Sep 2023 21:28:06 +0800 Subject: [PATCH] Remove println! statement, introduce is_external_source variable. --- src/common/src/util/row_id.rs | 2 -- src/frontend/src/handler/create_table.rs | 8 ++++---- src/frontend/src/optimizer/mod.rs | 7 ------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/common/src/util/row_id.rs b/src/common/src/util/row_id.rs index 7dc1ed9f4099d..074adb1350ecc 100644 --- a/src/common/src/util/row_id.rs +++ b/src/common/src/util/row_id.rs @@ -56,8 +56,6 @@ pub type RowId = i64; pub fn extract_vnode_id_from_row_id(id: RowId) -> VirtualNode { let vnode_id = ((id >> VNODE_ID_SHIFT_BITS) & (VNODE_ID_UPPER_BOUND as i64 - 1)) as u32; assert!(vnode_id < VNODE_ID_UPPER_BOUND); - - println!("row id {}, vnode {} ", id, vnode_id); VirtualNode::from_index(vnode_id as usize) } diff --git a/src/frontend/src/handler/create_table.rs b/src/frontend/src/handler/create_table.rs index 4f8ab8c605824..7c34ffb55d75d 100644 --- a/src/frontend/src/handler/create_table.rs +++ b/src/frontend/src/handler/create_table.rs @@ -655,6 +655,8 @@ fn gen_table_plan_inner( let connection_id = resolve_connection_in_with_option(&mut with_options, &schema_name, &session)?; + let is_external_source = source_info.is_some(); + let source = source_info.map(|source_info| PbSource { id: TableId::placeholder().table_id, schema_id, @@ -681,10 +683,8 @@ fn gen_table_plan_inner( }); let source_catalog = source.as_ref().map(|source| Rc::new((source).into())); - - println!("source catalog {:?}", source_catalog); let source_node: PlanRef = LogicalSource::new( - source_catalog.clone(), + source_catalog, columns.clone(), row_id_index, false, @@ -727,7 +727,7 @@ fn gen_table_plan_inner( append_only, watermark_descs, version, - source_catalog.is_some(), + is_external_source, )?; let mut table = materialize.table().to_prost(schema_id, database_id); diff --git a/src/frontend/src/optimizer/mod.rs b/src/frontend/src/optimizer/mod.rs index 8129a54fcecdf..ca941b88e12d7 100644 --- a/src/frontend/src/optimizer/mod.rs +++ b/src/frontend/src/optimizer/mod.rs @@ -16,29 +16,22 @@ use std::collections::HashMap; use std::ops::DerefMut; pub mod plan_node; - pub use plan_node::{Explain, PlanRef}; - pub mod property; mod delta_join_solver; mod heuristic_optimizer; mod plan_rewriter; - pub use plan_rewriter::PlanRewriter; - mod plan_visitor; - pub use plan_visitor::{ ExecutionModeDecider, PlanVisitor, RelationCollectorVisitor, SysTableVisitor, }; - mod logical_optimization; mod optimizer_context; mod plan_expr_rewriter; mod plan_expr_visitor; mod rule; - use fixedbitset::FixedBitSet; use itertools::Itertools as _; pub use logical_optimization::*;