Is one JSONL file enough? Format decides how many reworks
Format is not a technical detail; it decides who pays for rework. What a contract should pin is not “JSONL or Parquet” but the schema file, encoding and line endings, a nested-depth limit, and a hard zero-parse-failure requirement.
On this page
Three weeks into a two-million-row conversation delivery, your acceptance script prints one number: 3.1% of rows fail to parse. Four causes: unescaped newlines inside a record, a BOM at the start of the file, NaN written into numeric fields, and a label field that is sometimes null and sometimes the string “null”. The data may be perfectly fine. You still have to send it back, and two weeks disappear. This article is about removing those two weeks in the contract.
Start with the bill for one rework
A fictional scenario that anyone who has accepted a data delivery will recognise. You buy two million multi-turn conversations. The vendor ships an archive of JSONL files partitioned by date. Your script runs for forty minutes and reports 3.1% unparseable rows. Look closer: 1.2% because a message contained a raw newline and the record was split in two; 0.8% because the file starts with a BOM and the first line carries an invisible character; 0.7% because numeric fields contain NaN; 0.4% because the label field is written as the string “null” when empty, and your parser treats it as a real category.
None of these four is a data-quality problem. The text may be correct and the labels may be perfect. All four are delivery-shape problems. The consequence is identical to bad data: reject the batch, re-export, re-validate, move the training window. And the contract probably said “delivered in JSONL format”, five words that constrain none of the four cases.
What each format is actually for
Parquet is columnar: data is organised by column rather than by row, paired with encoding and compression, which suits bulk scans and queries that read only a few columns. The specification is public, the schema travels with the file, and readers do not need an external definition. The official documentation also warns about something buyers should quote: not all implementations support the same features of the format, and when several implementations are mixed in one workflow, compatibility has to be tested thoroughly.[1] That single sentence means “Parquet” is not a precise enough delivery description.
JSON Lines is row-oriented text: one JSON value per line. The specification has three hard requirements — UTF-8 encoding; each line is a valid JSON value, where a blank line is not valid but null is; and the line terminator is a newline, with a trailing newline strongly recommended. Following the JSON standard, a byte order mark must not be included. Files use the .jsonl extension, and .jsonl.gz when compressed.[2]
The two designs map onto two ways of working. Parquet suits “read everything at training time, prune columns, skip row groups”, at the cost of not being greppable and of rewriting a row group for a single edit. JSONL suits “process one record at a time, stream it, and locate a bad row by eye”, at the cost of size, no column pruning, and repeated field names on every line. The specification's own framing — convenient for data processed one record at a time, and for unix-style pipelines — is exactly that positioning.[2]
| Dimension | Parquet | JSONL |
|---|---|---|
| Layout | Columnar, row groups and column chunks | Row-oriented, one JSON value per line |
| Human readable | No, needs a reader library | Yes, cat, head and grep work |
| Size | Small, encoding plus compression | Large, text plus repeated field names |
| Read a few columns | Supported, cheap | Not supported, the whole row is parsed |
| Nested structure | Native, restored through level encoding | Expressed directly, structure repeated per line |
| Append and row edits | Append means new files; edits rewrite row groups | Append is just another line, the most natural case |
| Implementation risk | Real, feature support varies[1] | Low, parser behaviour is fairly uniform |
| Acceptance cost | Needs a Parquet-capable validator | A script or even shell can check line by line[2] |
So “which is better” is the wrong question. The real ones are: which format does your downstream consume, and should the other be delivered as a sample. The first decides the primary format, the second decides whether you can tell in half an hour whether the batch is correct.
Five forms of schema drift
Schema drift is not one thing called “the field changed”. It splits into five forms, each with a different failure mode and each with a different sentence in the contract.
| Form | Typical example | How it breaks | What to write |
|---|---|---|---|
| Rename | image_url becomes imageUrl | Lookup returns nothing and silently yields empty | Field names follow the schema file; a rename is a new version |
| Type change | The number 12 becomes the string “12” | Aggregation errors, or string sorting goes wrong | Types are declared and mandatory; a mismatch is a failed delivery |
| Nesting change | Turns sometimes an array, sometimes an array serialised into a string | The parser errors, or you read double-encoded data | Cap nesting depth; forbid JSON inside a string field |
| Enum growth | role gains system and tool | A downstream allow-list silently drops the new values | Enum sets change only with a schema version and prior notice |
| Null convention | Missing field, null, and empty string all in use | Empties become real categories and every count is wrong | One null representation only, written into the schema |
The third is the most expensive, because the first, second, fourth and fifth usually raise an error while the third does not. Your parser reads a string, the string contains valid JSON, and you train on an entire conversation as if it were flat text. Training runs, metrics appear, and the model learns something other than what you intended. This class of error is typically found after launch.
One more drift source gets ignored: encoding normalisation. UTF-8 is a hard requirement, but the same character can have several representations (combining versus precomposed). Chinese is barely affected; Vietnamese, Korean and accented Latin text are. If you run exact-match deduplication or string alignment, two batches normalised differently will deduplicate differently. It is a format issue that never appears on a quote sheet.
Eight clauses to put in the contract
- The schema file is a deliverable, not a verbal agreement. Use JSON Schema or an equivalent field list with name, type, required flag, enum values and maximum length, and give it a version such as v1.2.
- Zero parse failures, measured with the buyer's validation script. Do not write “correct format”; write “the attached script validates the full batch and reports zero failing rows”.
- UTF-8, no BOM; newline as the only line terminator; the last line must end with a newline. These three sentences are the specification's hard requirements.[2]
- Nesting rules: maximum depth, fixed element types in arrays, and no JSON serialised into a string field. This clause exists for the third drift form.
- Numbers and time: no NaN or infinity; timestamps in ISO 8601 with a timezone; booleans never written as strings.
- Sharding and naming: maximum file size, naming pattern, and a manifest with sha256, row count and byte size per shard. Confirm the sharding scheme before delivery and do not change it midway.
- Dual-format delivery: Parquet for the full set, naming the writer implementation and version[1], plus a thousand-line JSONL sample for manual spot checks and fast regression.[2]
- Change process: any schema change requires written notice in advance and a version bump; the previous version is retained for an agreed period; an unnotified change is a failed delivery.
{
"schema_version": "1.2",
"format": "jsonl",
"encoding": "utf-8",
"bom": false,
"line_terminator": "\n",
"fields": {
"id": {"type": "string", "required": true},
"turns": {
"type": "array",
"required": true,
"max_depth": 2,
"items": {
"role": {"type": "string", "enum": ["user", "assistant", "system", "tool"]},
"text": {"type": "string", "max_chars": 8000}
}
},
"label": {"type": ["string", "null"], "null_style": "absent_or_null_only"}
}
}Clause eight looks like legal boilerplate and is in fact an engineering control. An unnotified schema change will not crash your training script; it will quietly drop one field. By the time the metrics look wrong, three weeks have passed. Writing “unnotified change is a failed delivery” forces the change to require an approval step inside the vendor's own process.
The limits of format choice
Two limits worth stating plainly. First, the Parquet implementation issue is not theoretical: the official documentation says implementations differ in feature support and that mixing them requires compatibility testing.[1] So writing “Parquet” is not enough; you need which writer, which version, and which reader on the buyer side. Any mismatch among the three can produce a column that reads back empty. Second, the JSONL specification governs only three things and no business semantics[2]: it does not guarantee that a field exists, that a type holds, or that row order is stable. Row order is the sneakiest — if your train/validation split is taken by file order, a reordered delivery silently changes your evaluation set.
One action for today: paste the eight clauses into your procurement template, then run them against the last batch you accepted. You will probably find three or four that were not satisfied at the time. That result is more useful than any format debate, because it tells you how many problems in the last delivery went unnoticed.
