-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Improve usability of Merge tables #64864
Copy link
Copy link
Closed
Labels
Description
Currently, a Merge table takes the structure of the first (any) table.
Why don't take the union of columns of all tables and convert different types of identically named columns to the least supertype?
Additionally, we can allow inserts into Merge tables. They can be directed to the first table (if any), which data structure fits. A better option - among the tables with fitting data structures, insert to the table with the lexicographically greatest name (this allows usage of Merge tables for schema evolution, such as changing ORDER keys).
Motivation
clickhouse-cloud :) SELECT sum(cityHash64(*)) FROM merge('^text_log')
SELECT sum(cityHash64(*))
FROM merge('^text_log')
Query id: a594ec22-fe6a-476f-aacf-78ad7fdc4999
Elapsed: 0.246 sec.
Received exception from server (version 24.5.1):
Code: 10. DB::Exception: Received from kng4alm55c.us-east-2.aws.clickhouse-staging.com:9440. DB::Exception: Column `value1` not found in table default.text_log_10290440206184588366 (68320d6d-b8bc-4883-8fa3-9114c2a9ccdf). (NOT_FOUND_COLUMN_IN_BLOCK)
Reactions are currently unavailable