v.21.3New Feature
Added file function for reading files from user_files directory
Addedfilefunction to read file from user_files directory as a String. This is different from thefiletable function. This implements #issue:18851. #19204 (keenwolf).
Why it matters
This feature enables users to directly read and retrieve file contents as a text string within ClickHouse queries, simplifying workflows that require inline access to file data without using table functions or external tools.How to use it
Use thefile function by passing the filename located in the user_files directory to read its contents as a String. For example:SELECT file('example.txt')This function returns the entire file content as a single String.