You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/03/30 11:52:39 UTC

[GitHub] [orc] wgtmac commented on a diff in pull request #1455: ORC-1401: [C++] allow writing an intermediate footer

wgtmac commented on code in PR #1455:
URL: https://github.com/apache/orc/pull/1455#discussion_r1152674596


##########
c++/include/orc/OrcFile.hh:
##########
@@ -98,6 +98,11 @@ namespace orc {
      * Close the stream and flush any pending data to the disk.
      */
     virtual void close() = 0;
+
+    /**
+     * Flush any pending data to the disk.
+     */
+    virtual void flush() = 0;

Review Comment:
   What about providing a default implementation which throws an unimplemented exception? Otherwise I am afraid that it may break the downstream to upgrade smoothly.



##########
c++/include/orc/Writer.hh:
##########
@@ -303,6 +303,13 @@ namespace orc {
      * Add user metadata to the writer.
      */
     virtual void addUserMetadata(const std::string& name, const std::string& value) = 0;
+
+    /**
+     * Write an intermediate footer on the file such that if the file is
+     * truncated to the returned offset, it would be a valid ORC file.
+     * @return the offset that would be a valid end location for an ORC file
+     */
+    virtual long writeIntermediateFooter() = 0;

Review Comment:
   Better to use fixed-length type as `long` semantic varies among platforms.



##########
c++/include/orc/Writer.hh:
##########
@@ -303,6 +303,13 @@ namespace orc {
      * Add user metadata to the writer.
      */
     virtual void addUserMetadata(const std::string& name, const std::string& value) = 0;
+
+    /**
+     * Write an intermediate footer on the file such that if the file is
+     * truncated to the returned offset, it would be a valid ORC file.
+     * @return the offset that would be a valid end location for an ORC file
+     */
+    virtual long writeIntermediateFooter() = 0;

Review Comment:
   ```suggestion
       virtual int64_t writeIntermediateFooter() = 0;
   ```



-- 
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: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org