rtpsw commented on code in PR #33909:
URL: https://github.com/apache/arrow/pull/33909#discussion_r1094708520
##########
cpp/src/arrow/engine/substrait/options.cc:
##########
@@ -28,36 +28,58 @@
namespace arrow {
namespace engine {
+namespace {
+
+std::vector<compute::Declaration::Input> MakeDeclarationInputss(
+ const std::vector<DeclarationInfo>& inputs) {
+ std::vector<compute::Declaration::Input> input_decls(inputs.size());
+ for (size_t i = 0; i < inputs.size(); i++) {
+ input_decls[i] = inputs[i].declaration;
+ }
+ return input_decls;
+}
+
+} // namespace
+
class BaseExtensionProvider : public ExtensionProvider {
public:
- Result<RelationInfo> MakeRel(const std::vector<DeclarationInfo>& inputs,
+ Result<RelationInfo> MakeRel(const ConversionOptions& conv_opts,
+ const std::vector<DeclarationInfo>& inputs,
const ExtensionDetails& ext_details,
const ExtensionSet& ext_set) override {
auto details = dynamic_cast<const DefaultExtensionDetails&>(ext_details);
- return MakeRel(inputs, details.rel, ext_set);
+ return MakeRel(conv_opts, inputs, details.rel, ext_set);
}
- virtual Result<RelationInfo> MakeRel(const std::vector<DeclarationInfo>&
inputs,
+ virtual Result<RelationInfo> MakeRel(const ConversionOptions& conv_opts,
+ const std::vector<DeclarationInfo>&
inputs,
const google::protobuf::Any& rel,
const ExtensionSet& ext_set) = 0;
};
class DefaultExtensionProvider : public BaseExtensionProvider {
public:
- Result<RelationInfo> MakeRel(const std::vector<DeclarationInfo>& inputs,
+ Result<RelationInfo> MakeRel(const ConversionOptions& conv_opts,
+ const std::vector<DeclarationInfo>& inputs,
const google::protobuf::Any& rel,
const ExtensionSet& ext_set) override {
if (rel.Is<substrait_ext::AsOfJoinRel>()) {
substrait_ext::AsOfJoinRel as_of_join_rel;
rel.UnpackTo(&as_of_join_rel);
- return MakeAsOfJoinRel(inputs, as_of_join_rel, ext_set);
+ return MakeAsOfJoinRel(conv_opts, inputs, as_of_join_rel, ext_set);
+ }
+ if (rel.Is<substrait_ext::NamedTapRel>()) {
+ substrait_ext::NamedTapRel named_tap_rel;
+ rel.UnpackTo(&named_tap_rel);
+ return MakeNamedTapRel(conv_opts, inputs, named_tap_rel, ext_set);
}
return Status::NotImplemented("Unrecognized extension in Susbstrait plan:
",
rel.DebugString());
}
private:
- Result<RelationInfo> MakeAsOfJoinRel(const std::vector<DeclarationInfo>&
inputs,
+ Result<RelationInfo> MakeAsOfJoinRel(const ConversionOptions& conv_opts,
Review Comment:
It gets passed all the way to `MakeNamedTapRel`, which uses
`conv_opts.named_tap_mapper`.
--
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]