Package com.pkgrove.pkgrovekit.storage
Object JsonLinesRowFormat
-
- All Implemented Interfaces:
-
com.pkgrove.pkgrovekit.storage.RowPartFormat
public class JsonLinesRowFormat implements RowPartFormat
JSON Lines: one JSON array per row, positionally aligned with the schema (arrays, not objects — column names live once in the manifest, not per row). Values are the normalized JDK types of the core model: strings/booleans as JSON natives, numbers via BigDecimal plain strings (exact — never float round-tripping), temporal types as ISO-8601 strings, binary as base64. Decoding is schema-directed via ValueKind, so a round trip re-binds faithfully to JDBC.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringidprivate final StringfileExtensionpublic final static JsonLinesRowFormatINSTANCE
-
Method Summary
Modifier and Type Method Description Longwrite(Schema schema, Iterable<Row> rows, OutputStream out)Encode rows to out; returns the row count written. Sequence<RowBatch>read(Schema schema, InputStream input, Integer batchRows)Decode a part back into batches of at most batchRows rows. StringgetId()Stable identifier recorded in manifests (a reader must match it). StringgetFileExtension()Suggested key suffix, e.g. -
-
Method Detail
-
write
Long write(Schema schema, Iterable<Row> rows, OutputStream out)
-
read
Sequence<RowBatch> read(Schema schema, InputStream input, Integer batchRows)
Decode a part back into batches of at most batchRows rows. Streaming.
-
getFileExtension
String getFileExtension()
Suggested key suffix, e.g.
jsonl.
-
-
-
-