Skip to content

ScalarValue::iter_to_array doesn't support Duration and Union types #10132

@joroKr21

Description

@joroKr21

Describe the bug

This is causing troubles for one of our user-defined aggregation functions. I don't know if there's an easier way to reproduce the issue. But it looks to me like it should be straightforward to support those data types:

  • Duration is a primitive
  • Union is similar to Struct and List - a single element array

To Reproduce

I am not sure. I could post some code with the UDAF reproduction but maybe someone knows a way to trigger the issue directly with a query?

Edit - failing query:

SELECT tag, array_agg(millis - arrow_cast(secs, 'Timestamp(Millisecond, None)')) FROM t GROUP BY tag ORDER BY tag;

Expected behavior

ScalarValue::iter_to_array to support all data types (maybe except the views) but I would settle for those two.

Additional context

I'm preparing a PR but I need ideas for testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions