Skip to content

CTE join BUG #58500

Closed
Closed

Description

@h1k

Describe the unexpected behaviour
When a CTE expression is used to associate multiple tables, an exception is thrown, indicating that the table does not exist

How to reproduce

  • Which ClickHouse server version to use
    v23.3.18.15-lts
create table t  (ID UInt8) Engine= Memory() ;
insert into t values(1),(2),(3);
with a as (select 1 as column_a) , b as (select 2 as column_b) 
  select * FROM remote('127.0.0.{1,2}', default, t) as c
  inner join a on ID=column_a inner join b on ID=column_b

Expected behavior
Normal query

Error message and/or stacktrace
DB::Exception: Table default.a does not exist. Maybe you meant default.t?. (UNKNOWN_TABLE)

Additional context
Tried multiple versions in fiddle.clickhouse.com and all throw exception
https://fiddle.clickhouse.com/8d772c06-7026-4725-be20-710db3f7db56

Activity

  1. added
    unexpected behaviour
    on Jan 4, 2024
  2. added a commit that references this issue on Apr 10, 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

    unexpected behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions