From 56ce4e2bdf063c7a1cc5f565880c273c74fada7a Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 2 Jan 2024 18:31:57 +0800 Subject: [PATCH] fix(optimizer): internal tables return no stream key (#14303) --- src/frontend/src/optimizer/plan_node/generic/scan.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/src/optimizer/plan_node/generic/scan.rs b/src/frontend/src/optimizer/plan_node/generic/scan.rs index 63237581b12ae..b67e79177122c 100644 --- a/src/frontend/src/optimizer/plan_node/generic/scan.rs +++ b/src/frontend/src/optimizer/plan_node/generic/scan.rs @@ -24,6 +24,7 @@ use risingwave_common::util::column_index_mapping::ColIndexMapping; use risingwave_common::util::sort_util::ColumnOrder; use super::GenericPlanNode; +use crate::catalog::table_catalog::TableType; use crate::catalog::{ColumnId, IndexCatalog}; use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprVisitor, FunctionCall, InputRef}; use crate::optimizer::optimizer_context::OptimizerContextRef; @@ -343,6 +344,9 @@ impl GenericPlanNode for Scan { } fn stream_key(&self) -> Option> { + if matches!(self.table_catalog.table_type, TableType::Internal) { + return None; + } let id_to_op_idx = Self::get_id_to_op_idx_mapping(&self.output_col_idx, &self.table_desc); self.table_desc .stream_key