[feature] Add ArrowRecordReader for batch ingestion of Arrow IPC files#17871
Open
udaysagar2177 wants to merge 1 commit intoapache:masterfrom
Open
[feature] Add ArrowRecordReader for batch ingestion of Arrow IPC files#17871udaysagar2177 wants to merge 1 commit intoapache:masterfrom
udaysagar2177 wants to merge 1 commit intoapache:masterfrom
Conversation
The Arrow plugin previously only had ArrowMessageDecoder for streaming ingestion. This adds ArrowRecordReader implementing the RecordReader interface, enabling batch ingestion from Arrow IPC files. Changes: - Add ArrowRecordReader that reads Arrow IPC files using ArrowFileReader - Add ARROW to FileFormat enum and register in RecordReaderFactory - Generalize ArrowToGenericRowConverter to accept ArrowReader (parent of both ArrowStreamReader and ArrowFileReader) instead of ArrowStreamReader - Make convertSingleRow public with a reuse overload for row recycling - Add fieldsToRead filtering support to ArrowToGenericRowConverter - Add ArrowRecordReaderTest extending AbstractRecordReaderTest
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## master #17871 +/- ## ============================================ - Coverage 63.25% 63.22% -0.03% + Complexity 1499 1468 -31 ============================================ Files 3174 3190 +16 Lines 190373 192198 +1825 Branches 29089 29456 +367 ============================================ + Hits 120419 121520 +1101 - Misses 60610 61152 +542 - Partials 9344 9526 +182
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Arrow plugin previously only had
ArrowMessageDecoderfor streaming ingestion (e.g. Kafka). This PR addsArrowRecordReaderimplementing theRecordReaderinterface, enabling batch ingestion from Arrow IPC files, consistent with how other formats (Avro, JSON, ORC, Parquet, etc.) support both streaming and batch.Changes:
ArrowRecordReaderthat reads Arrow IPC files usingArrowFileReader, iterating row-by-row across batchesARROWtoFileFormatenum and register inRecordReaderFactoryArrowToGenericRowConverterto acceptArrowReader(parent of bothArrowStreamReaderandArrowFileReader) instead ofArrowStreamReaderconvertSingleRowpublic with a reuse overload for row recyclingfieldsToReadfiltering support toArrowToGenericRowConverterArrowRecordReaderTestextendingAbstractRecordReaderTest(10,000 random records across all Pinot field types, multi-batch writing, field filtering test)Note: Arrow IPC file format requires seekable channels, so gzip compression is not supported (test overridden to skip).
Test plan
ArrowRecordReaderTest.testRecordReader- 10,000 random records with all Pinot SV/MV field types, verifies read + rewindArrowRecordReaderTest.testFieldsToReadFiltering- verifies only requested fields are extractedArrowRecordReaderTest.testGzipRecordReader- overridden (Arrow IPC doesn't support gzip)ArrowMessageDecoderTesttests pass (no regressions from converter changes)RecordReaderFactoryTestpasses with new ARROW registration