Skip to content

Commit

Permalink
some more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Mar 3, 2023
1 parent fbc0630 commit a24d649
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions _posts/2023-03-03-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LOAD 'json';
The JSON extension supports various functions to create, read, and manipulate JSON strings.
These functions are similar to the JSON functionality provided by other databases such as [PostgreSQL](https://www.postgresql.org/docs/current/functions-json.html) and [MySQL](https://dev.mysql.com/doc/refman/8.0/en/json.html).
DuckDB uses [yyjson](https://github.com/ibireme/yyjson) internally to parse JSON, a high-performance JSON library written in ANSI C. Many thanks to the yyjson authors and contributors!

Besides these functions, DuckDB is now able to read JSON directly!
This is done by automatically detecting the types and column names, then converting the values within the JSON to DuckDB's vectors.
The automated schema detection dramatically simplifies working with JSON data and subsequent queries on DuckDB's vectors are significantly faster!
Expand All @@ -41,7 +42,7 @@ To demonstrate these, we will read `todos.json`, a [fake TODO list](https://json
]
```
Each TODO item is an entry in the JSON array, but in DuckDB, we'd like a table where each entry is a row.
In the latest release of DuckDB, this is now as easy as:
This is now (since DuckDB's 0.7.0 release in February 2023) as easy as:
```sql
SELECT * FROM 'todos.json';
```
Expand Down Expand Up @@ -331,8 +332,8 @@ LIMIT 5;
| Tmonster | 2 |
| lnkuiper | 2 |

As expected, Mark (Mytherin) was the most active!
My activity (lnkuiper) also shows up.
As expected, Mark (Mytherin, co-founder of DuckDB Labs) was the most active!
My activity (lnkuiper, software engineer at DuckDB Labs) also shows up.

## Handling inconsistent JSON schemas

Expand Down

0 comments on commit a24d649

Please sign in to comment.