mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2026-10-28 16:18:23 +08:00
Extend the generator to formats (generate-formats.sql + format_generators in the port, same mechanism as engines). Convert the 65 format pages whose structured docs reproduce the page (content-neutral / whitespace-only). Deferred (kept hand-written): pages that include shared Mintlify snippets (<PrettyFormatSettings/>, <RowBinaryFormatSettings/>, <DataTypeMapping/> from /snippets/) which the Docusaurus->Mintlify transform can't synthesize, and a few (Values, HiveText, Arrow, ArrowStream, Parquet) whose structured description is less complete than the page and needs enriching. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
175 lines
3.8 KiB
Plaintext
175 lines
3.8 KiB
Plaintext
---
|
|
alias: ['PrettyJSONLines', 'PrettyNDJSON']
|
|
description: 'Documentation for the PrettyJSONLines format'
|
|
input_format: false
|
|
keywords: ['PrettyJSONEachRow', 'PrettyJSONLines', 'PrettyNDJSON']
|
|
output_format: true
|
|
slug: /interfaces/formats/PrettyJSONEachRow
|
|
title: 'PrettyJSONEachRow'
|
|
doc_type: 'guide'
|
|
---
|
|
|
|
{/*AUTOGENERATED_START*/}
|
|
| Input | Output | Alias |
|
|
|-------|--------|-----------------------------------|
|
|
| ✗ | ✔ | `PrettyJSONLines`, `PrettyNDJSON` |
|
|
|
|
## Description {#description}
|
|
|
|
Differs from [JSONEachRow](/reference/formats/JSON/JSONEachRow) only in that JSON is pretty formatted with new line delimiters and 4 space indents.
|
|
|
|
## Example usage {#example-usage}
|
|
### Reading data {#reading-data}
|
|
|
|
Read data using the `PrettyJSONEachRow` format:
|
|
|
|
```sql
|
|
SELECT *
|
|
FROM football
|
|
FORMAT PrettyJSONEachRow
|
|
```
|
|
|
|
The output will be in JSON format:
|
|
|
|
```json
|
|
{
|
|
"date": "2022-04-30",
|
|
"season": 2021,
|
|
"home_team": "Sutton United",
|
|
"away_team": "Bradford City",
|
|
"home_team_goals": 1,
|
|
"away_team_goals": 4
|
|
}
|
|
{
|
|
"date": "2022-04-30",
|
|
"season": 2021,
|
|
"home_team": "Swindon Town",
|
|
"away_team": "Barrow",
|
|
"home_team_goals": 2,
|
|
"away_team_goals": 1
|
|
}
|
|
{
|
|
"date": "2022-04-30",
|
|
"season": 2021,
|
|
"home_team": "Tranmere Rovers",
|
|
"away_team": "Oldham Athletic",
|
|
"home_team_goals": 2,
|
|
"away_team_goals": 0
|
|
}
|
|
{
|
|
"date": "2022-05-02",
|
|
"season": 2021,
|
|
"home_team": "Port Vale",
|
|
"away_team": "Newport County",
|
|
"home_team_goals": 1,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-02",
|
|
"season": 2021,
|
|
"home_team": "Salford City",
|
|
"away_team": "Mansfield Town",
|
|
"home_team_goals": 2,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Barrow",
|
|
"away_team": "Northampton Town",
|
|
"home_team_goals": 1,
|
|
"away_team_goals": 3
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Bradford City",
|
|
"away_team": "Carlisle United",
|
|
"home_team_goals": 2,
|
|
"away_team_goals": 0
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Bristol Rovers",
|
|
"away_team": "Scunthorpe United",
|
|
"home_team_goals": 7,
|
|
"away_team_goals": 0
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Exeter City",
|
|
"away_team": "Port Vale",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 1
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Harrogate Town A.F.C.",
|
|
"away_team": "Sutton United",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Hartlepool United",
|
|
"away_team": "Colchester United",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Leyton Orient",
|
|
"away_team": "Tranmere Rovers",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 1
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Mansfield Town",
|
|
"away_team": "Forest Green Rovers",
|
|
"home_team_goals": 2,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Newport County",
|
|
"away_team": "Rochdale",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Oldham Athletic",
|
|
"away_team": "Crawley Town",
|
|
"home_team_goals": 3,
|
|
"away_team_goals": 3
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Stevenage Borough",
|
|
"away_team": "Salford City",
|
|
"home_team_goals": 4,
|
|
"away_team_goals": 2
|
|
}
|
|
{
|
|
"date": "2022-05-07",
|
|
"season": 2021,
|
|
"home_team": "Walsall",
|
|
"away_team": "Swindon Town",
|
|
"home_team_goals": 0,
|
|
"away_team_goals": 3
|
|
}
|
|
```
|
|
|
|
## Format settings {#format-settings}
|
|
{/*AUTOGENERATED_END*/}
|