junjunjd commented on code in PR #7901:
URL: https://github.com/apache/arrow-datafusion/pull/7901#discussion_r1378458769
##########
datafusion/common/src/scalar.rs:
##########
@@ -1562,7 +1597,11 @@ impl ScalarValue {
DataType::UInt16 =>
dict_from_values::<UInt16Type>(values)?,
DataType::UInt32 =>
dict_from_values::<UInt32Type>(values)?,
DataType::UInt64 =>
dict_from_values::<UInt64Type>(values)?,
- _ => unreachable!("Invalid dictionary keys type: {:?}",
key_type),
+ _ => {
+ return _internal_err!(
+ "Invalid dictionary keys type: {key_type:?}"
+ )
+ }
Review Comment:
I believe this error is reachable if the user passes dictionaries with
non-integer keys to the function. It is recoverable so I replaced
`unreachable!` with an internal error.
This does not require any code change in client side, since `iter_to_array`
already returns a Result.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]