Skip to content

The datafusion-cli panics when union 2 table with different number of columns. #3630

@HaoYang670

Description

@HaoYang670

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

DataFusion CLI v12.0.0
❯ create table t as select 1 as a, 2 as b;
0 rows in set. Query took 0.015 seconds.
❯ select a from t
union
select a as a1, a as a2 from t;
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', datafusion/common/src/dfschema.rs:161:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior
A clear and concise description of what you expected to happen.
We should return a Result will more precise error message

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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