Data Import
JSON Aggregate Functions
There are three JSON aggregate functions.  
<div class="narrow_table"></div>  
| Function | Description |
|:---|:----|
| `json_group_array(any)` | Return a JSON array with all values of `any` in the aggregation. |
| `json_group_object(key, value)` | Return a JSON object with all `key`, `value` pairs in the aggregation. |
| `json_group_structure(json)` | Return the combined `json_structure` of all `json` in the aggregation. |  
Examples:  
```sql
CREATE TABLE example1 (k VARCHAR, v INTEGER);
INSERT INTO example1 VALUES ('duck', 42), ('goose', 7);
```  
```sql
SELECT json_group_array(v) FROM example1;
```  
```text
[42, 7]
```  
```sql
SELECT json_group_object(k, v) FROM example1;
```  
```text
{"duck":42,"goose":7}
```  
```sql
CREATE TABLE example2 (j JSON);
INSERT INTO example2 VALUES
('{"family": "anatidae", "species": ["duck", "goose"], "coolness": 42.42}'),
('{"family": "canidae", "species": ["labrador", "bulldog"], "hair": true}');
```  
```sql
SELECT json_group_structure(j) FROM example2;
```  
```text
{"family":"VARCHAR","species":["VARCHAR"],"coolness":"DOUBLE","hair":"BOOLEAN"}
```