These functions are slow and may impose security considerations.
-
Install the
clickhouse-common-static-dbgpackage. - Set the allow_introspection_functions setting to 1. For security reasons introspection functions are disabled by default.
addressToLine
Introduced in: v20.1.0 Converts an address of an instruction inside the main ClickHouse executable to a filename and line number in ClickHouse’s source code. The address must be an offset inside the main ClickHouse executable, the form in which addresses are stored in thetrace columns of system.trace_log, system.stack_trace, and system.crash_log, and the last_error_trace column of system.error_log.
Runtime (virtual memory) addresses are not accepted, so that the function cannot be used to learn the memory layout of the server process.
Frames outside the main executable are stored as 0, and the function returns an empty result for them.
This function is slow and may impose security considerations.
- Install the
clickhouse-common-static-dbgpackage. - Set setting
allow_introspection_functionsto1.
This function is non-deterministic: it can return different results for the same arguments.
address_of_binary_instruction— Offset of an instruction inside the main ClickHouse executable, as stored in thetracecolumn ofsystem.trace_logand similar tables.UInt64
/build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199. Returns the name of the binary, if no debug information could be found for the address, or an empty string for 0. String
Examples
Selecting the first string from the trace_log system table
Query
Response
Query
Response
Query
Response
addressToLineWithInlines
Introduced in: v22.2.0 Similar toaddressToLine, but returns an Array with all inline functions.
As a result of this, it is slower than addressToLine.
The address must be an offset inside the main ClickHouse executable, the form in which addresses are stored in the trace columns of system.trace_log, system.stack_trace, and system.crash_log, and the last_error_trace column of system.error_log.
Runtime (virtual memory) addresses are not accepted, so that the function cannot be used to learn the memory layout of the server process.
Frames outside the main executable are stored as 0, and the function returns an empty result for them.
To enable this introspection function:
- Install the
clickhouse-common-static-dbgpackage. - Set setting
allow_introspection_functionsto1.
This function is non-deterministic: it can return different results for the same arguments.
address_of_binary_instruction— Offset of an instruction inside the main ClickHouse executable, as stored in thetracecolumn ofsystem.trace_logand similar tables.UInt64
0. Array(String)
Examples
Applying the function to an address
Query
Response
Query
Response
addressToSymbol
Introduced in: v20.1.0 Converts an address of an instruction inside the main ClickHouse executable to a symbol from ClickHouse’s object files. The address must be an offset inside the main ClickHouse executable, the form in which addresses are stored in thetrace columns of system.trace_log, system.stack_trace, and system.crash_log, and the last_error_trace column of system.error_log.
Runtime (virtual memory) addresses are not accepted, so that the function cannot be used to learn the memory layout of the server process.
Frames outside the main executable are stored as 0, and the function returns an empty result for them.
This function is non-deterministic: it can return different results for the same arguments.
address_of_binary_instruction— Offset of an instruction inside the main ClickHouse executable, as stored in thetracecolumn ofsystem.trace_logand similar tables.UInt64
0. String
Examples
Selecting the first string from the trace_log system table
Query
Response
Query
Response
Query
Response
demangle
Introduced in: v20.1.0 Converts a symbol to a C++ function name. The symbol is usually returned by functionaddressToSymbol.
Syntax
symbol— Symbol from an object file.String
String
Examples
Selecting the first string from the trace_log system table
Query
Response
Query
Response
Query
Response
isMergeTreePartCoveredBy
Introduced in: v25.6.0 Function which checks if the part of the first argument is covered by the part of the second argument. Syntaxnested_part— Name of expected nested part.Stringcovering_part— Name of expected covering part.String
1 if it covers, 0 otherwise. UInt8
Examples
Basic example
Query
Response
logTrace
Introduced in: v20.12.0 Emits a trace log message to the server log. The function accepts a constant argument only, so the call is evaluated during query analysis and replaced by its result. The message is therefore emitted once while the query is analyzed, and not once per processed Block: the number of rows and the settingmax_block_size have no effect
on how many messages appear in the log.
Syntax
message— Message that is emitted to the server log.const String
0 always. UInt8
Examples
Basic example
Query
Response
mergeTreePartInfo
Introduced in: v25.6.0 Function that helps to cut the useful values out of theMergeTree part name.
Syntax
part_name— Name of part to unpack.String
partition_id, min_block, max_block, level, mutation. Tuple
Examples
Basic example
Query
Response
tid
Introduced in: v20.12.0 Returns id of the thread, in which the current Block is processed. Syntax- None.
UInt64
Examples
Usage example
Query
Response