alamb commented on code in PR #13777: URL: https://github.com/apache/datafusion/pull/13777#discussion_r1885866169
########## datafusion/common/src/scalar/mod.rs: ########## @@ -5554,6 +5555,196 @@ mod tests { assert_eq!(&array, &expected); } + #[test] + fn round_trip() { + // Each array type should be able to round tripped through a scalar + let cases: Vec<ArrayRef> = vec![ + // int + Arc::new(Int8Array::from(vec![Some(1), None, Some(3)])), + Arc::new(Int16Array::from(vec![Some(1), None, Some(3)])), + Arc::new(Int32Array::from(vec![Some(1), None, Some(3)])), + Arc::new(Int64Array::from(vec![Some(1), None, Some(3)])), + Arc::new(UInt8Array::from(vec![Some(1), None, Some(3)])), + Arc::new(UInt16Array::from(vec![Some(1), None, Some(3)])), + Arc::new(UInt32Array::from(vec![Some(1), None, Some(3)])), + Arc::new(UInt64Array::from(vec![Some(1), None, Some(3)])), + // bool + Arc::new(BooleanArray::from(vec![Some(true), None, Some(false)])), + // float + Arc::new(Float32Array::from(vec![Some(1.0), None, Some(3.0)])), + Arc::new(Float64Array::from(vec![Some(1.0), None, Some(3.0)])), + // string array + Arc::new(StringArray::from(vec![Some("foo"), None, Some("bar")])), + Arc::new(LargeStringArray::from(vec![Some("foo"), None, Some("bar")])), + Arc::new(StringViewArray::from(vec![Some("foo"), None, Some("bar")])), + // string dictionary fails due to XXX Review Comment: Sorry -- that was a left over from when I though dictionary failed, and left an XXX in there as a placeholder when I filed a ticket -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org