mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-03 07:00:47 +00:00
e312229344
* Remove Berlin meetup link * Do not block browser while single page docs content loads * Restore sidebar scroll tracking feature * Temporary hide footer in single page docs mode so it does not jump around * Swap sidebars in single page docs mode * fix lost anchor in link * Explicitly fail if there are errors during docs build
19 lines
670 B
Markdown
19 lines
670 B
Markdown
<a name="table_functions-file"></a>
|
|
|
|
# file
|
|
|
|
`file(path, format, structure)` - returns a table created from a path file with a format type, with columns specified in structure.
|
|
|
|
path - a relative path to a file from [user_files_path](../operations/server_settings/settings.md#user_files_path).
|
|
|
|
format - file [format](../formats/index.md#formats).
|
|
|
|
structure - table structure in 'UserID UInt64, URL String' format. Determines column names and types.
|
|
|
|
**Example**
|
|
|
|
```sql
|
|
-- getting the first 10 lines of a table that contains 3 columns of UInt32 type from a CSV file
|
|
SELECT * FROM file('test.csv', 'CSV', 'column1 UInt32, column2 UInt32, column3 UInt32') LIMIT 10
|
|
```
|