MCPcopy Create free account
hub / github.com/apache/datafusion / test_cast_simple_column

Function test_cast_simple_column

datafusion/common/src/nested_struct.rs:554–565  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

552
553 #[test]
554 fn test_cast_simple_column() {
555 let source = Arc::new(Int32Array::from(vec![1, 2, 3])) as ArrayRef;
556 let target_field = field("ints", DataType::Int64);
557 let result =
558 cast_column(&source, target_field.data_type(), &DEFAULT_CAST_OPTIONS)
559 .unwrap();
560 let result = result.as_any().downcast_ref::<Int64Array>().unwrap();
561 assert_eq!(result.len(), 3);
562 assert_eq!(result.value(0), 1);
563 assert_eq!(result.value(1), 2);
564 assert_eq!(result.value(2), 3);
565 }
566
567 #[test]
568 fn test_cast_column_with_options() {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
cast_columnFunction · 0.85
fieldFunction · 0.70
data_typeMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…