Skip to content

Alias column not found in join #44365

Closed

Description

@viktor-klestov

Describe what's wrong

Query returns error

Does it reproduce on recent release?

yes

How to reproduce

create table test
(
    id           UInt64,
    val String alias 'some expression'
) ENGINE = MergeTree
order by tuple();
select val from numbers(1000) n join test t on n.number = t.id;

Error message and/or stacktrace

Received exception from server (version 22.8.1):
Code: 8. DB::Exception: Received from localhost:9000. DB::Exception: Cannot find column `val` in source stream, there are only columns: []. (THERE_IS_NO_COLUMN)

Additional context

Possibly related to known bug #13210 and similarly works if you swap tables

Activity

  1. added
    potential bug
    on Dec 19, 2022
  2. den-crane commented on Dec 19, 2022

    @den-crane
    Contributor

    workaround

    select val from numbers(1000) n left join (select id,val from test) t on n.number = t.id;
  3. added
    comp-joins
    on Dec 19, 2022
  4. added
    unexpected behaviour
    and removed
    potential bug
    on Dec 19, 2022
  5. added a commit that references this issue on Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-joinsunexpected behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions