You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/10/26 05:57:01 UTC
[GitHub] [orc] dongjoon-hyun commented on a change in pull request #941: ORC-1030: Java Tools may have missed OrcFile.MAGIC during file recovery
dongjoon-hyun commented on a change in pull request #941:
URL: https://github.com/apache/orc/pull/941#discussion_r736175281
##########
File path: java/tools/src/java/org/apache/orc/tools/FileDump.java
##########
@@ -470,17 +476,30 @@ private static void recoverFiles(final List<String> corruptFiles, final Configur
List<Long> footerOffsets = new ArrayList<>();
// start reading the data file form top to bottom and record the valid footers
- while (remaining > 0) {
- int toRead = (int) Math.min(DEFAULT_BLOCK_SIZE, remaining);
- byte[] data = new byte[toRead];
+ while (remaining > 0 && corruptFileLen > (2L * magicLength)) {
Review comment:
So, we don't care a tiny file whose size is less than 2 * magicLength because the correct ORC has at least two MAGIC strings?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@orc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org