Package dev.frostlake.executor.copy
Interface StageFileReader
- All Known Implementing Classes:
JsonStageReader,XmlStageReader
public interface StageFileReader
Reads a staged file of a record-based FILE_FORMAT (JSON, XML, Avro, Parquet, ORC) into a list of
JsonNode records. The COPY loader turns each record into a row via its existing JSON row-building
path, so the record formats share one loading path. CSV, being positional text rather than records, keeps
its own path in the loader.
Readers are discovered at runtime as a ServiceLoader SPI: each implementation is a
provider listed in META-INF/services/dev.frostlake.executor.copy.StageFileReader and is keyed by
formatType(). The zero-dependency JSON and XML readers ship in the engine; the heavier
Avro/Parquet/ORC readers live in the optional frostlake-formats module and light up only when it
is on the classpath — so the core engine carries no Hadoop/Avro/ORC dependencies. Adding a format is
"implement this interface and register the provider".
-
Method Summary
Modifier and TypeMethodDescriptionThe FILE_FORMAT TYPE this reader handles (e.g.List<tools.jackson.databind.JsonNode> readRecords(Path file) Parsefileinto its records.
-
Method Details
-
readRecords
Parsefileinto its records. An unreadable/malformed file throws (a bad load is never silent).- Throws:
IOException
-
formatType
String formatType()The FILE_FORMAT TYPE this reader handles (e.g."JSON"), matched case-insensitively.
-