Skip to content

Support Numeric -> Utf8View casting #6714

@Omega359

Description

@Omega359

Describe the bug

Casting from i32 to utf8View is not currently supported

To Reproduce

#[test]
    fn test_cast_i32_to_utf8view() {
        let array = Int32Array::from(vec![5, 6, 7, 8, 9]);
        let b = cast(&array, &DataType::Utf8View).unwrap();
        let c = b.as_any().downcast_ref::<StringViewArray>().unwrap();
        assert_eq!("5", c.value(0));
        assert_eq!("6", c.value(1));
        assert_eq!("7", c.value(2));
        assert_eq!("8", c.value(3));
        assert_eq!("9", c.value(4));
    }

Expected behavior

Casting from i32 to utf8view arrays is supported.

Additional context

Metadata

Metadata

Assignees

Labels

arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelog

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions