Class AvroReaders
java.lang.Object
dev.hardwood.avro.AvroReaders
Factory for creating AvroRowReader instances from a
ParquetFileReader.
Mirrors the noun / buildNoun shape of ParquetFileReader: the
no-arg rowReader(ParquetFileReader) returns the default reader;
buildRowReader(ParquetFileReader) returns a builder for
projection / filter / head / tail configuration.
try (ParquetFileReader fileReader = ParquetFileReader.open(inputFile);
AvroRowReader reader = AvroReaders.rowReader(fileReader)) {
while (reader.hasNext()) {
GenericRecord record = reader.next();
long id = (Long) record.get("id");
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds anAvroRowReaderwith optional projection, filter, and head/tail row limit. -
Method Summary
Modifier and TypeMethodDescriptionstatic AvroReaders.RowReaderBuilderbuildRowReader(ParquetFileReader reader) Begin configuring anAvroRowReaderwith optional projection, filter, and head/tail row limit.static AvroRowReaderrowReader(ParquetFileReader reader) Create anAvroRowReaderthat reads all rows and columns.
-
Method Details
-
rowReader
Create anAvroRowReaderthat reads all rows and columns. -
buildRowReader
Begin configuring anAvroRowReaderwith optional projection, filter, and head/tail row limit.
-