rtpsw commented on PR #34042:
URL: https://github.com/apache/arrow/pull/34042#issuecomment-1418041925

   > One thing wasn't clear to be is how do we dispatch some of the message to 
our extension provider vs use the default extension provider. For example, for 
the asof join message, I would imagine that being passed to the existing Acero 
extension provider - how would we handle that?
   
   The usual pattern would be chaining of an extension provider - something 
along the lines of
   ```
   class MyExtensionProvider {
   public:
     MyExtensionProvider(const std::shared_ptr<ExtensionProvider>& 
parent_provider) :
         parent_provider_(parent_provider) {}
   
     Result<RelationInfo> MakeRel(const std::vector<DeclarationInfo>& inputs,
                                  const google::protobuf::Any& rel,
                                  const ExtensionSet& ext_set) override {
       if (rel.Is<substrait_ext::MyRel>()) {
         substrait_ext::MyRel my_rel;
         rel.UnpackTo(&my_rel);
         return MakeMyRel(inputs, my_rel, ext_set);
       }
       return parent_provider_->MakeRel(inputs, rel, ext_set);
     }
   
     // MakeMyRel implementation here
   
   private:
     std::shared_ptr<ExtensionProvider> parent_provider_;
   };
   ```
   and for initialization
   ```
   
set_default_extension_provider(std::make_shared<MyExtensionProvider>(default_extension_provider());
   ```


-- 
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