The Filesystem database engine exposes files in a local directory as read-only tables. A table name is resolved as a path relative to the database directory and is read using the file table function.
Creating a database
path is the directory that contains the files. If it is omitted, ClickHouse uses the current directory in clickhouse-local and the user_files directory in ClickHouse server.
Usage
For example, with data.csv in the selected directory:
The table name can include a relative path beneath the database directory. The table schema and format are inferred in the same way as for the file table function.
The database owns no table definitions: tables are created when their files are first resolved and are only cached for subsequent access. CREATE TABLE, INSERT, and other writes through this database are not supported.
Access control
On ClickHouse server, the database directory and every resolved file must be inside user_files_path; this restriction also applies after following symlinks. clickhouse-local is not restricted to user_files_path.
Creating this database requires READ and WRITE source grants on FILE, regardless of table_engines_require_grant. Grant them with, for example:
See the SOURCES privileges for version and compatibility details.
See also
Last modified on September 10, 2026