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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to