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
{{ message }}
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/content/docs/cypher/query-clauses/load-from.md
+31-33Lines changed: 31 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,12 +147,12 @@ See the [ignoring erroneous rows section of `COPY FROM`](import#ignore-erroneous
147
147
`LOAD FROM` can scan several raw or in-memory file formats, such as CSV, Parquet, Pandas, Polars, Arrow tables, and JSON.
148
148
149
149
### File format detection
150
-
`Load from` determines the file format based on the file extension if the `file_format` option is not given. For instance, files with a `.csv` extension are automatically recognized as CSV format.
150
+
`LOAD FROM` determines the file format based on the file extension if the `file_format` option is not given. For instance, files with a `.csv` extension are automatically recognized as CSV format.
151
151
152
152
If the file format cannot be inferred from the extension, or if you need to override the default sniffing behaviour, the `file_format` option can be used.
153
153
154
154
For example, to load a CSV file that has a `.tsv` extension (for tab-separated data), you must explicitly specify the file format using the `file_format` option, as shown below:
155
-
```
155
+
```cypher
156
156
LOAD FROM 'data.tsv' (file_format='csv')
157
157
RETURN *
158
158
```
@@ -170,7 +170,7 @@ See the
170
170
](/import/csv#ignoring-erroneous-rows) documentation pages for the `COPY FROM` file.
171
171
The configurations documented in those pages can also be specified after the `LOAD FROM` statement inside `()` when scanning
172
172
CSV files. For example, you can indicate that the first line should
173
-
be interpreted as a header line by setting `(haders = true)` or that the CSV delimiter is '|' by setting `(DELIM="|")`.
173
+
be interpreted as a header line by setting `(headers = true)` or that the CSV delimiter is '|' by setting `(DELIM="|")`.
174
174
Some of these configurations are also by default [automatically detected](/import/csv#auto-detecting-configurations) by Kùzu when scanning CSV files.
175
175
These configurations determine the names and data types of the
176
176
variables that bind to the fields scanned from CSV files.
@@ -186,7 +186,7 @@ provide the names of the columns. The data types are always automatically inferr
186
186
if `LOAD WITH HEADERS (...) FROM` is used, in which case the data types provided inside the `(...)` are used as
187
187
described [above](#bound-variable-names-and-data-types)).
188
188
189
-
Suppose user.csv is a CSV file with the following contents:
189
+
Suppose `user.csv` is a CSV file with the following contents:
190
190
```
191
191
name,age
192
192
Adam,30
@@ -198,15 +198,14 @@ Then if you run the following query, Kùzu will infer the column names `name` an
198
198
199
199
```cypher
200
200
LOAD FROM "user.csv" (header = true) RETURN *;
201
-
-----------------
202
-
| name | age |
203
-
-----------------
204
-
| Adam | 30 |
205
-
-----------------
206
-
| Karissa | 40 |
207
-
-----------------
208
-
| Zhang | 50 |
209
-
-----------------
201
+
┌─────────┬───────┐
202
+
│ name │ age │
203
+
│ STRING │ INT64 │
204
+
├─────────┼───────┤
205
+
│ Adam │ 30 │
206
+
│ Karissa │ 40 │
207
+
│ Zhang │ 50 │
208
+
└─────────┴───────┘
210
209
```
211
210
212
211
@@ -220,15 +219,15 @@ Zhang,50
220
219
221
220
```cypher
222
221
LOAD FROM "user.csv" (header = false) RETURN *;
223
-
---------------------
224
-
| column0 | column1 |
225
-
---------------------
226
-
| Adam | 30 |
227
-
---------------------
228
-
| Karissa | 40|
229
-
---------------------
230
-
| Zhang | 50|
231
-
---------------------
222
+
┌─────────┬─────────┐
223
+
│ column0 │ column1 │
224
+
│ STRING │ STRING │
225
+
├─────────┼─────────┤
226
+
│ name │ age │
227
+
│ Adam │ 30 │
228
+
│ Karissa │ 40 │
229
+
│ Zhang │ 50│
230
+
└─────────┴─────────┘
232
231
```
233
232
234
233
### Parquet
@@ -240,15 +239,14 @@ and the same content as in the `user.csv` file above. Then the query below will
240
239
241
240
```cypher
242
241
LOAD FROM "user.parquet" RETURN *;
243
-
----------------
244
-
| f0 | f1 |
245
-
----------------
246
-
| Adam | 30 |
247
-
----------------
248
-
| Karissa | 40 |
249
-
----------------
250
-
| Zhang | 50 |
251
-
----------------
242
+
┌─────────┬───────┐
243
+
│ f0 │ f1 │
244
+
│ STRING │ INT64 │
245
+
├─────────┼───────┤
246
+
│ Adam │ 30 │
247
+
│ Karissa │ 40 │
248
+
│ Zhang │ 50 │
249
+
└─────────┴───────┘
252
250
```
253
251
254
252
### Pandas
@@ -350,5 +348,5 @@ age: [[30,40,50]]
350
348
```
351
349
352
350
### JSON
353
-
Kùzu can scan JSON files using `LOAD FROM`.
354
-
All JSON-related features are part of the JSON extension. See the documentation on the [JSON extension](/extensions/json#load-from) for details.
351
+
Kùzu can scan JSON files using `LOAD FROM`, but only upon installation of the JSON extension.
352
+
See the documentation on the [JSON extension](/extensions/json#load-from) for details.
0 commit comments