Hello, We are developing a data store based on ORC files and using the C++ API. We are using min/max statistics from the row index, bloom filters and our custom partitioning stuff to read only the required rows from the ORC files. This implementation relies on the seekToRow() method in the RowReader class to seek the appropriate row groups and then read the batch. I am noticing that the seekToRow() is not efficient and degrades the performance, even if just a few row groups have to be read. Some numbers from my testing :-
Number of rows in ORC file : 30 million File Size : 845 MB (7 stripes) Number of Columns : 16 (tpc-h lineitem table) Sequential read of all rows/all columns : 10 seconds Read only 1% of the row groups using seek (forward direction only) : 1.5 seconds Read only 3% of the row groups using seek (forward direction only) : 12 seconds Read only 4% of the row groups using seek (forward direction only) : 20 seconds Read only 5% of the row groups using seek (forward direction only) : 33 seconds I tried the Java API and implemented the same filtering logic via predicate push down and got good numbers with the same ORC file :- Sequential read of all rows/all columns : 18 seconds Match & read 20% of row groups : 7 seconds Match & read 33% of row groups.: 11 seconds Match & read 50% of row groups : 13.5 seconds I think the seekToRow() implementation needs to use the row index positions and read only the appropriate stream portions(like the Java API). The current seekToRow() implementation starts over from the beginning of the stripe for each seek. I would like to work on changing the seekToRow() implementation, if this is not actively being worked on right now by anyone. The seek is critical for us as we have multiple feature paths that need to read only portions of the ORC file. I am looking for opinion from the community and contributors. Thanks, Shankar
