HIVE-29123: Extend ProtobufInputFormat to handle EOFException for par…#6010
HIVE-29123: Extend ProtobufInputFormat to handle EOFException for par…#6010saihemanth-cloudera merged 2 commits intoapache:masterfrom
Conversation
…tially written proto files
|
is that trying to solve same issue as #5983? |
Based on the description provided in the PR, the issue appears to be different compared to #5983. @rtrivedi12, can you please provide steps for how you created "partially written dag data file." which you used for testing? |
This This partially written dag_data file was created by executing a long- running query and killing the yarn application in between which leaves a partially written dag_data file by Tez |
ql/src/java/org/apache/hadoop/hive/ql/io/protobuf/LenientProtobufMessageInputFormat.java
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/io/protobuf/LenientProtobufMessageInputFormat.java
Outdated
Show resolved
Hide resolved
|
I believe the relationship between this PR and this codepath below should be clarified: If this PR calls the new RecordReader a SafeRecordReader, then maybe we need to change it to distinguish between the two "safe" things:
|
Good point, missed it! It may be confusing with Parent SafeRecordReader; I will rename and clarify in the Java doc. |
|



…tially written proto files
What changes were proposed in this pull request?
This PR introduces a more lenient version of ProtobufInputFormat that ignores EOFException when reading partially written proto files.
ProtobufMessageInputFormat skips zero-byte files by creating , which ignores EOFException.
Why are the changes needed?
Abrupt AM termination or OOM failures can result in partially written protobuf files. When reading data from the corresponding external table, these incomplete files may trigger an EOFException, causing the entire query to fail.
To improve resilience, it would be better to gracefully skip unreadable or corrupted proto files and continue reading the remaining valid data, instead of failing the entire query.
Does this PR introduce any user-facing change?
Yes, this would silently skip reading partially written proto files instead of failing with EOFException.
How was this patch tested?
Manually tested with a sample partially written dag data file.