Skip to content

Add ambiguous check when generate projection plan #4210

@ygf11

Description

@ygf11

Describe the bug
When the two table both has c0, then the following sql will work:

❯ explain select c0 from test0, test1;
+---------------+-----------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                |
+---------------+-----------------------------------------------------------------------------------------------------+
| logical_plan  | Projection: test0.c0                                                                                |
|               |   CrossJoin:                                                                                        |
|               |     TableScan: test0 projection=[c0]                                                                |
|               |     TableScan: test1 projection=[c0]                                                                |

The projection part of this sql is not clear, datafusion should throw an error.

To Reproduce
Create two table test0 and test1, which both contain c0.
Run sql explain select c0 from test0, test1;

Expected behavior

Additional context

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