Skip to content

Commit

Permalink
Add some information on JSON input formats
Browse files Browse the repository at this point in the history
Signed-off-by: Davis Silverman <[email protected]>
  • Loading branch information
sinistersnare committed Nov 18, 2024
1 parent cfc5cd3 commit 23f8fd5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rust/perspective-client/docs/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,35 @@ table.replace(df)
</div>

<div class="warning">`limit` cannot be used in conjunction with `index`.</div>

# JSON Input Data

Perspective supports many kinds of input data, including two formats of JSON
data: row-oriented and column-oriented data.

## Row Oriented JSON

Row-oriented JSON is in the form of a list of objects. Each object in the list
corresponds to a row in the table. For example:

```json
[
{ "a": 86, "b": false, "c": "words" },
{ "a": 0, "b": true, "c": "" },
{ "a": 12345, "b": false, "c": "here" }
]
```

## Column Oriented JSON

Column-Oriented JSON comes in the form of an object of lists. Each key of the
object is a column name, and each element of the list is the corresponding value
in the row.

```json
{
"a": [86, 0, 12345],
"b": [false, true, false],
"c": ["words", "", "here"]
}
```

0 comments on commit 23f8fd5

Please sign in to comment.