[ 
https://issues.apache.org/jira/browse/ARROW-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373390#comment-16373390
 ] 

ASF GitHub Bot commented on ARROW-2184:
---------------------------------------

wesm commented on a change in pull request #1642: ARROW-2184: [C++]  Add static 
constructor for FileOutputStream returning shared_ptr to OutputStream
URL: https://github.com/apache/arrow/pull/1642#discussion_r170084165
 
 

 ##########
 File path: cpp/src/arrow/io/file.h
 ##########
 @@ -39,6 +39,21 @@ class ARROW_EXPORT FileOutputStream : public OutputStream {
  public:
   ~FileOutputStream() override;
 
+  /// \brief Open a local file for writing, truncating any existing file
+  /// \param[in] path with UTF8 encoding
+  /// \param[out] out a base interface OutputStream instance
+  ///
+  /// When opening a new file, any existing file with the indicated path is
+  /// truncated to 0 bytes, deleting any existing memory
+  static Status Open(const std::string& path, std::shared_ptr<OutputStream>* 
out);
+
+  /// \brief Open a local file for writing
+  /// \param[in] path with UTF8 encoding
+  /// \param[in] append append to existing file, otherwise truncate to 0 bytes
+  /// \param[out] out a base interface OutputStream instance
+  static Status Open(const std::string& path, bool append,
+                     std::shared_ptr<OutputStream>* out);
 
 Review comment:
   We need some unit tests for these. We should also change the Python bindings 
to use these APIs

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] Add static ctor for FileOutputStream returning shared_ptr to base 
> OutputStream
> ------------------------------------------------------------------------------------
>
>                 Key: ARROW-2184
>                 URL: https://issues.apache.org/jira/browse/ARROW-2184
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Panchen Xue
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> It would be useful for most IO ctors to return pointers to the base interface 
> that they implement rather than the subclass. Whether we deprecate the 
> current ones will vary on a case by case basis



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to