Skip to content

Commit d8426bf

Browse files
committed
adapter: remove unreachable code in statement_logging, for peek results
1 parent a7bb9a2 commit d8426bf

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/adapter/src/statement_logging.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,8 @@ impl From<&ExecuteResponse> for StatementEndedExecutionReason {
150150
fn from(value: &ExecuteResponse) -> StatementEndedExecutionReason {
151151
match value {
152152
ExecuteResponse::CopyTo { resp, .. } => match resp.as_ref() {
153-
// NB [btv]: It's not clear that this combination
154-
// can ever actually happen.
155153
ExecuteResponse::SendingRowsImmediate { rows, .. } => {
156-
// Note(parkmycar): It potentially feels bad here to iterate over the entire
157-
// iterator _just_ to get the encoded result size. As noted above, it's not
158-
// entirely clear this case ever happens, so the simplicity is worth it.
159-
let result_size: usize = rows.box_clone().map(|row| row.byte_len()).sum();
160-
StatementEndedExecutionReason::Success {
161-
result_size: Some(u64::cast_from(result_size)),
162-
rows_returned: Some(u64::cast_from(rows.count())),
163-
execution_strategy: Some(StatementExecutionStrategy::Constant),
164-
}
154+
panic!("SELECTs terminate on peek finalization, not here.")
165155
}
166156
ExecuteResponse::SendingRows { .. } => {
167157
panic!("SELECTs terminate on peek finalization, not here.")
@@ -185,17 +175,7 @@ impl From<&ExecuteResponse> for StatementEndedExecutionReason {
185175
}
186176

187177
ExecuteResponse::SendingRowsImmediate { rows, .. } => {
188-
// Note(parkmycar): It potentially feels bad here to iterate over the entire
189-
// iterator _just_ to get the encoded result size, the number of Rows returned here
190-
// shouldn't be too large though. An alternative is to pre-compute some of the
191-
// result size, but that would require always decoding Rows to handle projecting
192-
// away columns, which has a negative impact for much larger response sizes.
193-
let result_size: usize = rows.box_clone().map(|row| row.byte_len()).sum();
194-
StatementEndedExecutionReason::Success {
195-
result_size: Some(u64::cast_from(result_size)),
196-
rows_returned: Some(u64::cast_from(rows.count())),
197-
execution_strategy: Some(StatementExecutionStrategy::Constant),
198-
}
178+
panic!("SELECTs terminate on peek finalization, not here.")
199179
}
200180

201181
ExecuteResponse::AlteredDefaultPrivileges

0 commit comments

Comments
 (0)