Skip to content

Support string concat || for StringViewArray #11766

Closed
@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

datafusion-cli

Then run

DataFusion CLI v40.0.0
> create table foo as values ('value1', arrow_cast('one', 'Utf8View')), ('value1', arrow_cast('two', 'Utf8View'));
0 row(s) fetched.
> select column2||'ff' from foo;
Internal error: Data type Utf8View not supported for binary operation 'concat_elements' on string arrays.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

Describe the solution you'd like
I would like the query to work

Describe alternatives you've considered
We can probably get the query to work by fixing the coercion logic to coerce to Utf8, but that will be less efficient than implementing native StringView support for concat

The coercion is here:

StringConcat => {
string_concat_coercion(lhs, rhs).map(Signature::uniform).ok_or_else(|| {
plan_datafusion_err!(
"Cannot infer common string type for string concat operation {lhs} {op} {rhs}"
)
})
}

The physical expression implementation starts here

StringConcat => binary_string_array_op!(left, right, concat_elements),

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions