Skip to content

Support Union as a function #10206

@jayzhan211

Description

@jayzhan211

Is your feature request related to a problem or challenge?

We have recently issues show that it is time to support Union

#10161 #10139 ScalarValue::iter_to_array
#10180 comparison_coercion

I think the first step is able to create Union in slt file.

Describe the solution you'd like

Follow DuckDB Union or others well-known system.

https://duckdb.org/docs/sql/data_types/union.html

First step might be able to create table with union type

query error DataFusion error: Error during planning: Inconsistent data type across values list at row 1 column 0\. Was Int64 but found Utf8
create table t1 (u union(num interger, str varchar)) as values
  (1),
  ('two');

Describe alternatives you've considered

No response

Additional context

  1. Built Union on top of Struct
  2. Impl with ScalarUDFImpl

Metadata

Metadata

Assignees

No one assigned

    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