Skip to content

Query parameters + WITH + AS column doesn't expand. #33000

Closed

Description

@UnamedRus

Describe the unexpected behaviour
Query parameters doesn't expand when they being used in WITH and aliased to already exist column name.

How to reproduce
ClickHouse 21.13

clickhouse-client -mn --param_test_a="30" --query "WITH {test_a:UInt32} as column SELECT column as number FROM numbers(2) FORMAT TSVWithNames"
number
0
1

clickhouse-client -mn --param_test_a="30" --query "WITH {test_a:UInt32} as column SELECT {test_a:UInt32} as number FROM numbers(2) FORMAT TSVWithNames"
number
30
30

clickhouse-client -mn --param_test_a="30" --query "WITH {test_a:UInt32} as column SELECT column FROM numbers(2) FORMAT TSVWithNames"
column
30
30

Activity

  1. added
    unexpected behaviour
    on Dec 21, 2021
  2. UnamedRus commented on Mar 27, 2023

    @UnamedRus
    ContributorAuthor

    Related #42648

    23.2
    ❯ clickhouse-client -mn --param_test_a="30" --query "WITH {test_a:UInt32} as column SELECT column as number FROM numbers(2) FORMAT TSVWithNames" --allow_experimental_analyzer 1
    number
    30
    30
    ❯ clickhouse-client -mn --param_test_a="30" --query "WITH {test_a:UInt32} as column SELECT column as number FROM numbers(2) FORMAT TSVWithNames" --allow_experimental_analyzer 0
    number
    0
    1
    
  3. 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