You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/25 23:31:56 UTC

[GitHub] [arrow] westonpace commented on pull request #12721: ARROW-16033: [C++] Pass schema to consuming sink node

westonpace commented on pull request #12721:
URL: https://github.com/apache/arrow/pull/12721#issuecomment-1079515105


   There is an entirely different implementation we could take (pass the schema in an init method before anything runs):
   
   ```
   class ARROW_EXPORT SinkNodeConsumer {
    public:
     virtual ~SinkNodeConsumer() = default;
     /// \brief Initialize the consumer with the schema of the batches that will arrive
     virtual Status Init(const std::shared_ptr<Schema>& schema) = 0;
     /// \brief Consume a batch of data
     virtual Status Consume(ExecBatch batch) = 0;
     /// \brief Signal to the consumer that the last batch has been delivered
     ///
     /// The returned future should only finish when all outstanding tasks have completed
     virtual Future<> Finish() = 0;
   };
   ```
   
   Pros:
    * More obvious that the schema will never change
   Cons:
    * More methods that have to be implemented
    
    Opinions?  @lidavidm @vibhatha @paleolimbot 


-- 
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: github-unsubscribe@arrow.apache.org

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