2018-07-27 10:21:04 +00:00
|
|
|
|
|
|
|
# url
|
|
|
|
|
2018-09-06 18:15:16 +00:00
|
|
|
`url(URL, format, structure)` - returns a table created from the `URL` with given
|
|
|
|
`format` and `structure`.
|
2018-07-27 10:21:04 +00:00
|
|
|
|
2018-12-25 15:25:43 +00:00
|
|
|
URL - HTTP or HTTPS server address, which can accept `GET` and/or `POST` requests.
|
2018-07-27 10:21:04 +00:00
|
|
|
|
2018-09-06 18:15:16 +00:00
|
|
|
format - [format](../../interfaces/formats.md#formats) of the data.
|
2018-07-27 10:21:04 +00:00
|
|
|
|
2018-09-06 18:15:16 +00:00
|
|
|
structure - table structure in `'UserID UInt64, Name String'` format. Determines column names and types.
|
2018-07-27 10:21:04 +00:00
|
|
|
|
|
|
|
**Example**
|
|
|
|
|
2018-10-16 10:47:17 +00:00
|
|
|
``` sql
|
2018-09-06 18:15:16 +00:00
|
|
|
-- getting the first 3 lines of a table that contains columns of String and UInt32 type from HTTP-server which answers in CSV format.
|
2018-07-27 10:21:04 +00:00
|
|
|
SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3
|
|
|
|
```
|
2018-10-16 10:47:17 +00:00
|
|
|
|
|
|
|
[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/url/) <!--hide-->
|