Closed DatGuyJonathan closed 5 months ago
I think the minimal repro is this (the client sends the requests similar to the following curls):
curl "http://localhost:8123?param_target=mv_target" \
--data-binary "CREATE OR REPLACE TABLE {target: Identifier} (i Int32) ENGINE MergeTree ORDER BY i;"
(adding an extra src table as it was missing from the OP)
curl "http://localhost:8123?param_src=mv_src" \
--data-binary "CREATE OR REPLACE TABLE {src: Identifier} (i Int32) ENGINE MergeTree ORDER BY i;"
Creating the MV:
curl "http://localhost:8123?param_target=mv_target¶m_src=mv_src¶m_mv_name=mv" \
--data-binary "CREATE MATERIALIZED VIEW {mv_name: Identifier} TO {target: Identifier} AS SELECT * FROM {src: Identifier};"
Which fails with the same error:
Code: 60. DB::Exception: Both table name and UUID are empty. (UNKNOWN_TABLE) (version 24.3.1.2672 (official build))
I will clarify with the team if it's possible to parametrize the TO ...
clause as of now.
It is confirmed that, unfortunately, this is a current limitation of ClickHouse.
@DatGuyJonathan, here's the issue in the main repo to keep track: https://github.com/ClickHouse/ClickHouse/issues/62892
Thank you @slvrtrn!
I'm using client@1.0.1 & server@24.1.3. I'm trying to create a table, then a materialized view. The commands & their params look like this, and this works fine:
If I change
TO MonthlyAggregatedData_0_0
intoTO {targetTableName: Identifier}
, I get this error:If I change
TO MonthlyAggregatedData_0_0
intoTO {targetTableName: String}
, I get this error:Is there a specific way to parameterize the
TO
clause when creating a materialized view?Please let me know if I can provide more info. Thanks in advance.