Skip to content

WITH array and "No alias for non-trivial value in ARRAY JOIN" #4432

Closed

Description

@filimonov
SELECT version()

┌─version()─┐
│ 19.3.3    │
└───────────┘

-- ok:
SELECT x
FROM system.one 
ARRAY JOIN [1, 2] AS x

┌─x─┐
│ 1 │
│ 2 │
└───┘

-- ok:

SELECT 
    [1, 2] AS zz, 
    x
FROM system.one 
ARRAY JOIN zz AS x

┌─zz────┬─x─┐
│ [1,2] │ 1 │
│ [1,2] │ 2 │
└───────┴───┘

-- wrong:
WITH [1, 2] AS zz
SELECT x
FROM system.one 
ARRAY JOIN zz AS x

Received exception from server (version 19.3.3):
Code: 206. DB::Exception: Received from localhost:9000, ::1. DB::Exception: No alias for non-trivial value in ARRAY JOIN: x. 

Activity

  1. added
    bug
    on Feb 18, 2019
  2. self-assigned this
    on Feb 25, 2019
  3. qoega commented on Apr 8, 2020

    @qoega
    Member

    reproduces in 20.3+

  4. MrSsunlight commented on Aug 24, 2020

    @MrSsunlight

    I encountered the same problem in version 20.3.11.97

  5. removed their assignment
    on Oct 16, 2020
  6. alexey-milovidov commented on Aug 15, 2021

    @alexey-milovidov
    Member

    Reproduced on 21.9.

  7. alexey-milovidov commented on Aug 15, 2021

    @alexey-milovidov
    Member
  8. tylerhannan commented on Apr 7, 2023

    @tylerhannan
    Member

    An update that, while not fixed, the allow_experimental_analyzer flag will be useful for this...

    An example...

    https://pastila.nl/?02680ab3/9e7308809ec48009844702187c5c9150

  9. added a commit that references this issue on Apr 3, 2024
  10. tema-popov commented on May 23, 2024

    @tema-popov

    I get the same error running the following SQL on Clickhouse Cloud:

    WITH [1, 2] AS zz
    SELECT x
    FROM system.one 
    ARRAY JOIN zz AS x
    
    { "meta": [ ], "data": [ ], "rows": 0, "exception": "Code: 206. DB::Exception: No alias for non-trivial value in ARRAY JOIN: x: While processing WITH [1, 2] AS zz SELECT x FROM system.one ARRAY JOIN [1, 2] AS x. (ALIAS_REQUIRED) (version 24.2.2.16100 (official build))" }
    
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

    bugminor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions