Skip to content

substring does not support Utf8View or BinaryView #10671

Closed

Description

@1fanwang

Describe the bug

substring() rejects the view types:

substring(Utf8View  ) ERR: Compute error: substring does not support type Utf8View
substring(BinaryView) ERR: Compute error: substring does not support type BinaryView
substring(Dict<Utf8View>) ERR: Compute error: substring does not support type Utf8View

It takes Utf8, LargeUtf8, Binary, LargeBinary, FixedSizeBinary and Dictionary, so a caller holding StringViewArray has to cast to Utf8 first, which copies the data.

The other string kernels in the same crate already take views: length, bit_length, like and concat_elements all have DataType::Utf8View arms. substring.rs is the only file in arrow-string/src that handles Utf8 and never mentions Utf8View.

To Reproduce

use arrow_array::StringViewArray;
use arrow_string::substring::substring;

let array = StringViewArray::from(vec![Some("hello world")]);
let err = substring(&array, 0, Some(5)).unwrap_err();
assert_eq!(err.to_string(), "Compute error: substring does not support type Utf8View");

Expected behavior

substring accepts Utf8View and BinaryView and returns the same values the Utf8 and Binary paths return for the same input, including for a dictionary whose values are a view array.

Additional context

Not listed under #6163.

Activity

  1. added a commit that references this issue on Aug 14, 2026
    e6dbdbd
  2. added a commit that references this issue on Aug 19, 2026
    72e8925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions