v.22.2Improvement

Support EXPLAIN AST for CREATE FUNCTION Queries

Support EXPLAIN AST CREATE FUNCTION query EXPLAIN AST CREATE FUNCTION mycast AS (n) -> cast(n as String) will return EXPLAIN AST CREATE FUNCTION mycast AS n -> CAST(n, 'String'). #33819 (李扬).
Support for EXPLAIN AST on CREATE FUNCTION queries: Users can now use the EXPLAIN AST command to view the abstract syntax tree (AST) representation of CREATE FUNCTION statements in ClickHouse.

Why it matters

This feature helps users understand how ClickHouse parses and represents user-defined functions by providing an AST output for CREATE FUNCTION queries. It aids in debugging, optimization, and learning by making the internal query structure transparent.

How to use it

Use the EXPLAIN AST keyword before a CREATE FUNCTION query to get the AST output. For example:

EXPLAIN AST CREATE FUNCTION mycast AS (n) -> cast(n as String)

This will return the parsed AST format of the function definition.