Skip to content

Comparison for nested type #5407

@jayzhan211

Description

@jayzhan211

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

Ref #9252

I want to be able to compare ListArray. The comparison order is left to right and if the prefix is the same then it is considered.
lesser.

For example,

  • List(1,2,3) < List(1,2,3,4)
  • List(List(1,2,3), List(10)) < List(List(1,2,4), List(1))
  • List(List(1,2,3), List(1)) > List(List(1,2,2), List(2))

The behavior takes Duckdb's array sort as a reference.

Describe the solution you'd like

Support nested types in compare_op, currently failed on this line.

    if l_t != r_t || l_t.is_nested() {
        return Err(ArrowError::InvalidArgumentError(format!(
            "Invalid comparison operation: {l_t} {op} {r_t}"
        )));
    }

Describe alternatives you've considered

Additional context

We can support most of the ops in the future, lt and eq are two that I would like to work on first

Metadata

Metadata

Assignees

Labels

enhancementAny new improvement worthy of a entry in the changelog

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions