Given a row, find the stripe that contains that row. @param reader the file reader @param row the global row number in the file @return the information about that row in the file
(Reader reader, long row)
| 84 | * @return the information about that row in the file |
| 85 | */ |
| 86 | static LocationInfo findStripeInfo(Reader reader, long row) { |
| 87 | long firstRow = 0; |
| 88 | int stripeId = 0; |
| 89 | for (StripeInformation stripe: reader.getStripes()) { |
| 90 | long lastRow = firstRow + stripe.getNumberOfRows(); |
| 91 | if (firstRow <= row && row < lastRow) { |
| 92 | return new LocationInfo(firstRow, lastRow, stripeId, row); |
| 93 | } |
| 94 | firstRow = lastRow; |
| 95 | stripeId += 1; |
| 96 | } |
| 97 | return new LocationInfo(reader.getNumberOfRows(), |
| 98 | reader.getNumberOfRows(), reader.getStripes().size(), row); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Given a failure point, find the first place that the ORC reader can |
no test coverage detected