MCPcopy Create free account
hub / github.com/apache/paimon-rust / test_build_column_float_double

Function test_build_column_float_double

crates/paimon/src/arrow/format/avro.rs:802–810  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

800
801 #[test]
802 fn test_build_column_float_double() {
803 let records = make_records(vec![vec![("f", av_float(1.5)), ("d", av_float(2.5))]]);
804 let fcol = build_column(&records, "f", &DataType::Float(FloatType::new()), 1).unwrap();
805 let dcol = build_column(&records, "d", &DataType::Double(DoubleType::new()), 1).unwrap();
806 let farr = fcol.as_any().downcast_ref::<Float32Array>().unwrap();
807 let darr = dcol.as_any().downcast_ref::<Float64Array>().unwrap();
808 assert!((farr.value(0) - 1.5_f32).abs() < f32::EPSILON);
809 assert!((darr.value(0) - 2.5_f64).abs() < f64::EPSILON);
810 }
811
812 #[test]
813 fn test_build_column_with_nulls() {

Callers

nothing calls this directly

Calls 3

make_recordsFunction · 0.85
build_columnFunction · 0.85
as_anyMethod · 0.45

Tested by

no test coverage detected