MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_create_decimal_array

Function test_create_decimal_array

arrow/src/util/data_gen.rs:847–862  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

845
846 #[test]
847 fn test_create_decimal_array() {
848 let size = 10;
849 let fields = vec![
850 Field::new("a", DataType::Decimal128(10, -2), true),
851 Field::new("b", DataType::Decimal256(10, -2), true),
852 ];
853 let schema = Schema::new(fields);
854 let schema_ref = Arc::new(schema);
855 let batch = create_random_batch(schema_ref.clone(), size, 0.35, 0.7).unwrap();
856
857 assert_eq!(batch.schema(), schema_ref);
858 assert_eq!(batch.num_columns(), schema_ref.fields().len());
859 for array in batch.columns() {
860 assert_eq!(array.len(), size);
861 }
862 }
863
864 #[test]
865 fn create_non_nullable_decimal_array_with_null_density() {

Callers

nothing calls this directly

Calls 3

create_random_batchFunction · 0.85
cloneMethod · 0.45
columnsMethod · 0.45

Tested by

no test coverage detected