Skip to content

Implement native function of reverse #1538

@slfan1989

Description

@slfan1989

Background and Motivation:

Currently, we do not have a native implementation of reverse that aligns with Spark SQL behavior. To improve compatibility with Spark functions and reduce dependency on UDFs, we need to implement this function, supporting string inputs.

Objective and Scope:

Add a new native scalar function: reverse(expr), supporting the following data types:

  • String: Utf8, LargeUtf8
  • Support for scalar and column vector (array) mixed input paths, ensuring consistent ColumnarValue behavior with existing built-in functions.
  • Null semantics aligned with Spark.

Expected Behavior (Aligned with Spark):

  • reverse(string): Reverse the string according to Unicode code points.

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