Skip to content

Commit 3111235

Browse files
authored
chore: change Result to Option to avoid bring error stack (#13901)
1 parent d5e217e commit 3111235

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/query/catalog/src/plan/stream_column.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ impl StreamTablePart {
7878
}))
7979
}
8080

81-
pub fn from_part(info: &PartInfoPtr) -> Result<&StreamTablePart> {
82-
info.as_any()
83-
.downcast_ref::<StreamTablePart>()
84-
.ok_or(ErrorCode::Internal(
85-
"Cannot downcast from PartInfo to StreamTablePart.",
86-
))
81+
pub fn from_part(info: &PartInfoPtr) -> Option<&StreamTablePart> {
82+
info.as_any().downcast_ref::<StreamTablePart>()
8783
}
8884

8985
pub fn inner(&self) -> Partitions {

src/query/sql/src/executor/table_read_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl ToReadDataSourcePlan for dyn Table {
113113
let mut base_block_ids = None;
114114
if parts.partitions.len() == 1 {
115115
let part = parts.partitions[0].clone();
116-
if let Ok(part) = StreamTablePart::from_part(&part) {
116+
if let Some(part) = StreamTablePart::from_part(&part) {
117117
parts = part.inner();
118118
base_block_ids = Some(part.base_block_ids());
119119
}

0 commit comments

Comments
 (0)