Repository navigation
ORC-1401: [C++] allow writing an intermediate footer - #1455
Conversation
There was a problem hiding this comment.
Thank you for filing a JIRA and making a PR, @hinxx .
I clicked the CI approval button in order to trigger the tests.
- flushing with the clean file close - flushing without the file close
wgtmac
left a comment
There was a problem hiding this comment.
Thanks for the change! I haven't gone through all the change. Will take a deep look over the weekend.
wgtmac
left a comment
There was a problem hiding this comment.
Could you please make the CI happy?
|
Some CI checks fail due to following reason, please use In addition, the C++ format check failures can be fixed by applying |
|
I checked the CI logs and I think I solved all the issue regarding the data types and formatting. |
Seems the build on macos has a different opinion. |
This is becoming embarrassing. I would expect to see these sign related errors in my Linux g++ build, but for some reason I don't. |
Current C++ code base does not support writing intermediate footers as Java code base does. It would be beneficial to the C++ based writers to have an ability to write intermediate footer(s) to the opened file while streaming data into it. The benefit is not losing the so far persisted data (after flushing stripes) in case of writer failure in closing the file (application crash). The writer that wants to support the feature would follow similar approach as Hive does in writing a side file with the latest footer offsets. The reader would be able to determine the location of the last valid footer by using the last footer location from the side file (instead of assuming that the footer is at the end of the file). The change was tested by creating a small ORC file writer test application that calls newly added WriterImpl::writeIntermediateFooter() after adding a batch of rows: The resulting ORC file is readable by the provided stock C++ and Java tools. This closes apache#1455
Current C++ code base does not support writing intermediate footers as Java code base does.
It would be beneficial to the C++ based writers to have an ability to write intermediate footer(s) to the opened file while streaming data into it. The benefit is not losing the so far persisted data (after flushing stripes) in case of writer failure in closing the file (application crash).
The writer that wants to support the feature would follow similar approach as Hive does in writing a side file with the latest footer offsets. The reader would be able to determine the location of the last valid footer by using the last footer location from the side file (instead of assuming that the footer is at the end of the file).
The change was tested by creating a small ORC file writer test application that calls newly added
WriterImpl::writeIntermediateFooter()after adding a batch of rows:The resulting ORC file is readable by the provided stock C++ and Java tools. The preliminary C++ test code and results from the tools are attached to this PR here notes.txt.
Not all aspects of the possible use were tested yet namely unclean writer app shutdown, writing of the side file, loading of the side file, reading of the last valid footer when file was not properly closed.
This is a draft PR. No proper tests are added at the moment because of incomplete PR.
I'm looking for opinions from the ORC experts in order to finish up the PR.