v.21.8Improvement

Use Map Data Type for System Logs Tables in ClickHouse

Use Map data type for system logs tables (system.query_log, system.query_thread_log, system.processes, system.opentelemetry_span_log). These tables will be auto-created with new data types. Virtual columns are created to support old queries. Closes #18698. #23934, #25773 (hexiaoting, sundy-li, Maksim Kita).
ClickHouse system log tables (system.query_log, system.query_thread_log, system.processes, system.opentelemetry_span_log) now use the Map data type for certain columns, improving data structure and access.

Why it matters

This feature updates system log tables to utilize the Map data type, which offers better flexibility and efficiency for storing complex key-value data. It maintains backward compatibility by creating virtual columns that support existing queries, solving the challenge of evolving internal data formats without breaking user workflows.

How to use it

These system log tables are auto-created with the new Map data types after updating ClickHouse. Users do not need to manually enable this change; existing queries continue to work seamlessly via virtual columns that map old data types to the new structure.