Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create parameterized view with union all clauses #50672

Open
Zarathustra2 opened this issue Jun 7, 2023 · 0 comments
Open

Cannot create parameterized view with union all clauses #50672

Zarathustra2 opened this issue Jun 7, 2023 · 0 comments

Comments

@Zarathustra2
Copy link

Describe the unexpected behaviour
Cannot create parameterized view with union all clauses

How to reproduce

  • Which ClickHouse server version to use
  • 23.4.2.11
CREATE TABLE default.foo
(
    `open` Float64,
    `close` Float64,
    `high` Float64,
    `low` Float64,
    `ticker` LowCardinality(String),
    `time` DateTime,
    `tags` Array(LowCardinality(String))
)
ENGINE = MergeTree
ORDER BY ticker;

Works:

create view works as (
      (
        select *
        from foo 
        where close = 1 and ticker = {arg:String}
      ) 
)

Does not work:

create view issue as (
      (
        select *
        from foo 
        where close = 1 and ticker = {arg:String}
      ) UNION ALL (
        select *
        from foo 
        where close = 2 and ticker = {arg:String}
      )
)

CREATE VIEW issue AS

SELECT *
FROM foo
WHERE (close = 1) AND (ticker = {arg:String})
UNION ALL
SELECT *
FROM foo
WHERE (close = 2) AND (ticker = {arg:String})

Query id: 0e544b71-54c0-4eb3-8948-9bb27759b680


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 23.4.2):
Code: 456. DB::Exception: Received from localhost:9000. DB::Exception: Query parameter `arg` was not set. (UNKNOWN_QUERY_PARAMETER)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant