Skip to content

Apache DataFusion SQL Query Engine

ARROW-11246: [Rust] Add type to Unexpected accumulator state error

Dmitry Patsura8eb91ca1faff
diff --git a/rust/datafusion/src/physical_plan/distinct_expressions.rs b/rust/datafusion/src/physical_plan/distinct_expressions.rs
index 9aa639a431..33001d393b 100644
--- a/rust/datafusion/src/physical_plan/distinct_expressions.rs
+++ b/rust/datafusion/src/physical_plan/distinct_expressions.rs
@@ -132,9 +132,10 @@ impl Accumulator for DistinctCountAccumulator {
.iter()
.map(|state| match state {
ScalarValue::List(Some(values), _) => Ok(values),
- _ => Err(DataFusionError::Internal(
- "Unexpected accumulator state".to_string(),
- )),
+ _ => Err(DataFusionError::Internal(format!(
+ "Unexpected accumulator state {:?}",
+ state
+ ))),
})
.collect::<Result<Vec<_>>>()?;