Skip to content

Commit f16744f

Browse files
committed
fix
1 parent 72f3a29 commit f16744f

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

src/query/functions/src/aggregates/adaptors/aggregate_null_adaptor.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use std::fmt;
1616
use std::sync::Arc;
1717

18+
use databend_common_exception::ErrorCode;
1819
use databend_common_exception::Result;
1920
use databend_common_expression::types::Bitmap;
2021
use databend_common_expression::types::DataType;
@@ -189,15 +190,19 @@ impl<const NULLABLE_RESULT: bool> AggregateFunction for AggregateNullUnaryAdapto
189190
}
190191

191192
fn serialize_binary(&self, _: AggrState, _: &mut Vec<u8>) -> Result<()> {
192-
unreachable!()
193+
Err(ErrorCode::Internal(
194+
"Calls to serialize_binary should be refactored to calls to serialize",
195+
))
193196
}
194197

195198
fn merge(&self, place: AggrState, data: &[ScalarRef]) -> Result<()> {
196199
self.0.merge(place, data)
197200
}
198201

199202
fn merge_binary(&self, _: AggrState, _: &mut &[u8]) -> Result<()> {
200-
unreachable!()
203+
Err(ErrorCode::Internal(
204+
"Calls to merge_binary should be refactored to calls to merge",
205+
))
201206
}
202207

203208
fn merge_states(&self, place: AggrState, rhs: AggrState) -> Result<()> {
@@ -318,15 +323,19 @@ impl<const NULLABLE_RESULT: bool> AggregateFunction
318323
}
319324

320325
fn serialize_binary(&self, _: AggrState, _: &mut Vec<u8>) -> Result<()> {
321-
unreachable!()
326+
Err(ErrorCode::Internal(
327+
"Calls to serialize_binary should be refactored to calls to serialize",
328+
))
322329
}
323330

324331
fn merge(&self, place: AggrState, data: &[ScalarRef]) -> Result<()> {
325332
self.0.merge(place, data)
326333
}
327334

328335
fn merge_binary(&self, _: AggrState, _: &mut &[u8]) -> Result<()> {
329-
unreachable!()
336+
Err(ErrorCode::Internal(
337+
"Calls to merge_binary should be refactored to calls to merge",
338+
))
330339
}
331340

332341
fn merge_states(&self, place: AggrState, rhs: AggrState) -> Result<()> {

src/query/functions/src/aggregates/adaptors/aggregate_ornull_adaptor.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use std::fmt;
1616
use std::sync::Arc;
1717

18+
use databend_common_exception::ErrorCode;
1819
use databend_common_exception::Result;
1920
use databend_common_expression::types::Bitmap;
2021
use databend_common_expression::types::DataType;
@@ -198,7 +199,9 @@ impl AggregateFunction for AggregateFunctionOrNullAdaptor {
198199
}
199200

200201
fn serialize_binary(&self, _: AggrState, _: &mut Vec<u8>) -> Result<()> {
201-
unreachable!()
202+
Err(ErrorCode::Internal(
203+
"Calls to serialize_binary should be refactored to calls to serialize",
204+
))
202205
}
203206

204207
fn merge(&self, place: AggrState, data: &[ScalarRef]) -> Result<()> {
@@ -210,7 +213,9 @@ impl AggregateFunction for AggregateFunctionOrNullAdaptor {
210213
}
211214

212215
fn merge_binary(&self, _: AggrState, _: &mut &[u8]) -> Result<()> {
213-
unreachable!()
216+
Err(ErrorCode::Internal(
217+
"Calls to merge_binary should be refactored to calls to merge",
218+
))
214219
}
215220

216221
fn merge_states(&self, place: AggrState, rhs: AggrState) -> Result<()> {

src/query/functions/src/aggregates/aggregate_combinator_if.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,19 @@ impl AggregateFunction for AggregateIfCombinator {
164164
}
165165

166166
fn serialize_binary(&self, _: AggrState, _: &mut Vec<u8>) -> Result<()> {
167-
unreachable!()
167+
Err(ErrorCode::Internal(
168+
"Calls to serialize_binary should be refactored to calls to serialize",
169+
))
168170
}
169171

170172
fn merge(&self, place: AggrState, data: &[ScalarRef]) -> Result<()> {
171173
self.nested.merge(place, data)
172174
}
173175

174176
fn merge_binary(&self, _: AggrState, _: &mut &[u8]) -> Result<()> {
175-
unreachable!()
177+
Err(ErrorCode::Internal(
178+
"Calls to merge_binary should be refactored to calls to merge",
179+
))
176180
}
177181

178182
fn merge_states(&self, place: AggrState, rhs: AggrState) -> Result<()> {

src/query/functions/src/aggregates/aggregate_combinator_state.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use std::fmt;
1616
use std::sync::Arc;
1717

18+
use databend_common_exception::ErrorCode;
1819
use databend_common_exception::Result;
1920
use databend_common_expression::types::Bitmap;
2021
use databend_common_expression::types::DataType;
@@ -117,15 +118,19 @@ impl AggregateFunction for AggregateStateCombinator {
117118
}
118119

119120
fn serialize_binary(&self, _: AggrState, _: &mut Vec<u8>) -> Result<()> {
120-
unreachable!()
121+
Err(ErrorCode::Internal(
122+
"Calls to serialize_binary should be refactored to calls to serialize",
123+
))
121124
}
122125

123126
fn merge(&self, place: AggrState, data: &[ScalarRef]) -> Result<()> {
124127
self.nested.merge(place, data)
125128
}
126129

127130
fn merge_binary(&self, _: AggrState, _: &mut &[u8]) -> Result<()> {
128-
unreachable!()
131+
Err(ErrorCode::Internal(
132+
"Calls to merge_binary should be refactored to calls to merge",
133+
))
129134
}
130135

131136
fn merge_states(&self, place: AggrState, rhs: AggrState) -> Result<()> {

0 commit comments

Comments
 (0)