You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/developer/10-apis/http.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,7 @@ This handler return results in `pages` with long-polling.
19
19
1. A `GET` to the `next_uri` returns the next `page` of query results. It returns `QueryResponse` too, processing it
20
20
the same way until `next_uri` is null.
21
21
2. (optional) A `GET` to the `kill_uri` to kill the query. Return empty body.
22
-
3. (optional) A `GET` to the `stats_uri` to get stats only at once (without long-polling), return `QueryResponse`
23
-
with empty `data` field.
22
+
24
23
25
24
Please note that you should keep using the latest `next_uri` to get the next page of results before the query is finished, otherwise you may miss some results or leak session resources until session timeout. The `next_uri` will be null when you have received all the results of the query.
Copy file name to clipboardExpand all lines: docs/en/guides/40-load-data/01-load/02-local.md
+47-4Lines changed: 47 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,16 @@ Uploading your local data files to a stage or bucket before loading them into Da
7
7
8
8
Please note that the files must be in a format supported by Databend, otherwise the data cannot be imported. For more information on the file formats supported by Databend, see [Input & Output File Formats](/sql/sql-reference/file-format-options).
9
9
10
+
You can also load local files into tables programmatically using JDBC or Python drivers.
11
+
12
+
## Load Methods
13
+
14
+
There are two methods to load data from local files:
15
+
16
+
1.**Stage**: Upload the local file to an internal stage, then copy data from the staged file into the table. File upload occurs either through databend-query or using a presigned URL, depending on the `presigned_url_disabled` connection option (default: `false`).
17
+
2.**Streaming**: Load the file directly into the table during upload. Use this method when the file is too large to store as a single object in your object storage.
18
+
19
+
10
20
## Tutorial 1 - Load from a Local File
11
21
12
22
This tutorial uses a CSV file as an example to demonstrate how to import data into Databend using [BendSQL](../../30-sql-clients/00-bendsql/index.md) from a local source.
@@ -47,14 +57,48 @@ CREATE TABLE books (
47
57
Send loading data request with the following command:
48
58
49
59
```shell
50
-
❯ bendsql --query='INSERT INTO book_db.books VALUES;' --format=csv [email protected]
60
+
❯ bendsql --query='INSERT INTO book_db.books from @_databend_load file_format=(type=csv)'[email protected]
61
+
```
62
+
63
+
- The `@_databend_load` is a placeholder representing local file data.
64
+
- The [file_format clause](/sql/sql-reference/file-format-options/) uses the same syntax as the COPY command.
0 commit comments