mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
1.0 KiB
1.0 KiB
slug | sidebar_position | sidebar_label |
---|---|---|
/en/sql-reference/functions/files | 75 | Files |
file
Reads file as string and loads the data into the specified column. The actual file content is not interpreted.
Also see table function file.
Syntax
file(path[, default])
Arguments
path
— The path of the file relative to user_files_path. Supports the following wildcards:*
,?
,{abc,def}
and{N..M}
whereN
,M
are numbers and'abc', 'def'
are strings.default
— The value that will be returned in the case the file does not exist or cannot be accessed. Supported data types: String and NULL.
Example
Inserting data from files a.txt and b.txt into a table as strings:
Query:
INSERT INTO table SELECT file('a.txt'), file('b.txt');