alamb commented on a change in pull request #793: URL: https://github.com/apache/arrow-datafusion/pull/793#discussion_r680188812
########## File path: datafusion/src/scalar.rs ########## @@ -1347,6 +1545,29 @@ mod tests { "{}", result); } + #[test] + fn scalar_try_from_array_null() { + let array = vec![Some(33), None].into_iter().collect::<Int64Array>(); + let array: ArrayRef = Arc::new(array); + + assert_eq!( + ScalarValue::Int64(Some(33)), + ScalarValue::try_from_array(&array, 0).unwrap() + ); + assert_eq!( + ScalarValue::Int64(None), + ScalarValue::try_from_array(&array, 1).unwrap() + ); + } + + #[test] + fn scalar_try_from_dict_datatype() { + let data_type = + DataType::Dictionary(Box::new(DataType::Int8), Box::new(DataType::Utf8)); + let data_type = &data_type; Review comment: Amusingly, supporting this behavior ended up causing a test to fail when I brought the code into IOx and I think I traced the problem to an issue in parquet file statistics: https://github.com/apache/arrow-rs/issues/641 🤣 this was not a side effect I had anticipated -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org