Expand description
Per-arrow-type value formatting for both CSV and JSONL.
CSV rules:
- Null → empty cell.
- Complex types (list, struct, map, binary, duration, interval, union, …) → error.
- Binary & binary-view types → error (user should use JSONL).
- Timestamps, dates, times → ISO-8601 strings.
- Floats:
NaN,inf,-inf. - Decimals: standard decimal-point string.
JSONL rules:
- Null →
null. - Binary → string of
\xHHescapes (lowercase hex). - Timestamps → ISO-8601 (with tz suffix if zoned).
- Floats:
"NaN","Infinity","-Infinity"as JSON strings (numbers otherwise). - Decimals → raw unscaled integer (may exceed JavaScript’s safe range).
- List / Struct / Map / FixedSizeList → JSON array / object.
- Dictionary → decoded to its value type.
Constants§
- BINARY_
PLACEHOLDER - Literal placeholder used in CSV and JSONL when
--binary-format noneis set.
Functions§
- csv_
cell - Format a single cell for CSV. Returns
Nonefor null (writer emits an empty field). - json_
value - Format a single cell as a
serde_json::Value. - table_
cell - Format a single cell for table output. Strictly more permissive than CSV: primitives render exactly the same way, but nested types (lists, structs, maps, …) fall through to the JSONL renderer and are serialised compactly. Null becomes an empty string.
- validate_
csv_ schema - Reject types that cannot be represented losslessly in CSV. All four binary
flavors are accepted under any
--binary-format: the value is rendered as hex, base64, or the literal “BINARY_DATA” placeholder.