yiguolei commented on code in PR #16940:
URL: https://github.com/apache/doris/pull/16940#discussion_r1131919993
##########
docs/zh-CN/docs/data-operate/import/import-way/stream-load-manual.md:
##########
@@ -236,6 +236,31 @@ Stream Load 由于使用的是 HTTP 协议,所以所有导入任务有关的
}
```
+### 使用SQL表达Stream Load的参数
+
+可以在Header中添加一个`sql`的参数,去替代之前参数中的`column_separator`、`line_delimiter`、`where`、`columns`参数,方便使用。
+
+```
+curl --location-trusted -u user:passwd [-H "sql: ${load_sql}"...] -T data.file
-XPUT http://fe_host:http_port/api/{db}/{table}/_stream_load_with_sql
+
+
+# -- load_sql
+# insert into db.table (col, ...) select stream_col, ... from
stream("property1"="value1");
+
+# stream
+# (
+# "column_separator" = ",",
+# "format" = "CSV",
+# ...
+# )
+```
+
+示例:
+
+```
+curl --location-trusted -u root: -T test.csv -H "sql:insert into
demo.example_tbl_1(user_id, age, cost) select c1, c4, c7 * 2 from
stream("format" = "CSV", "column_separator" = "," ) where age >= 30"
http://127.0.0.1:28030/api/demo/example_tbl_1/_stream_load_with_sql
Review Comment:
do not set db and table name in url. they already in insert clause.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]