You need to enable JavaScript to run this app.
ByteHouse 企业版

ByteHouse 企业版

复制全文
表函数
url
复制全文
url

url 函数从 URL 创建一个具有给定 formatstructure 的表。
url 函数可用于对URL表中的数据进行 SELECTINSERT 的查询中。
语法

url(URL, format, structure)

参数
URL — HTTP或HTTPS服务器地址,它可以接受 GETPOST 请求 (对应于 SELECTINSERT 查询)。类型: String。
format — 数据格式。类型: String。
structure — 以 'UserID UInt64, Name String' 格式的表结构。确定列名和类型。 类型: String。
返回值
A table with the specified format and structure and with data from the defined URL.
示例
获取一个表的前3行,该表是从HTTP服务器获取的包含 String 和 UInt32 类型的列,以CSV格式返回。

SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3;

URL 的数据插入到表中:

CREATE TABLE test_table (column1 String, column2 UInt32) ENGINE=Memory;
INSERT INTO FUNCTION url('http://127.0.0.1:8123/?query=INSERT+INTO+test_table+FORMAT+CSV', 'CSV', 'column1 String, column2 UInt32') VALUES ('http interface', 42);
SELECT * FROM test_table;

原始文章

最近更新时间:2024.11.11 17:54:05
这个页面对您有帮助吗?
有用
有用
无用
无用