Skip to content

feat: add native concat_ws support for array<string> arguments #5687

Description

@peterxcli

What is the problem the feature request solves?

PR #5679 fixed concat_ws correctness for array<string> arguments by routing those expressions through Spark codegen dispatch, with Spark fallback when the dispatcher is disabled. This avoids the native execution failure from #5675, but these valid Spark expressions still have no native path.

Spark accepts any ordered mix of string and array<string> arguments after the separator. It flattens array elements in argument order, skips null string arguments and null array elements, and returns null for a null separator. DataFusion's built-in concat_ws accepts only string arguments.

This follows the maintainer suggestion in #5679 (comment).

Describe the potential solution

Add a Spark-compatible native concat_ws implementation for mixed string and array<string> inputs, then allow the array shape through CometConcatWs instead of codegen dispatch.

Coverage should include:

  • mixed scalar and array arguments, preserving argument and element order;
  • multiple arrays;
  • null scalar arguments, null arrays, and null array elements;
  • empty arrays and a null separator;
  • non-foldable column inputs through the native execution path.

Keep the existing dispatcher/fallback guard until the native implementation covers these semantics.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions