Skip to content

Trailing comma output misleading error message #9949

@alexandreyc

Description

@alexandreyc

Describe the bug

Putting a trailing comma after the last column/expression within a select statement produces a misleading error message.

To Reproduce

When running the following:

create table my_table as (
    select 'Alice' as name, 42 as age
    union all
    select 'Bob' as name, 1337 as age
);

select
    name,
    age,
from
    my_table

We got the following error message:

Schema error: No field named name.

Expected behavior

Either:

  • Accepting trailing comma
  • Have an informative error message

Additional context

It took me a while to figure out the issue so I though that it might be helpful to improve on this.

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