vibhatha commented on code in PR #13500:
URL: https://github.com/apache/arrow/pull/13500#discussion_r912588156
##########
cpp/src/arrow/engine/substrait/serde.cc:
##########
@@ -204,6 +203,48 @@ Result<compute::ExecPlan> DeserializePlan(
return MakeSingleDeclarationPlan(declarations);
}
+Result<std::vector<UdfDeclaration>> DeserializePlanUdfs(
+ const Buffer& buf, const ExtensionIdRegistry* registry) {
+ ARROW_ASSIGN_OR_RAISE(auto plan, ParseFromBuffer<substrait::Plan>(buf));
+
+ ARROW_ASSIGN_OR_RAISE(auto ext_set, GetExtensionSetFromPlan(plan, registry,
true));
+
+ std::vector<UdfDeclaration> decls;
+ /*
+ for (const auto& ext : plan.extensions()) {
+ switch (ext.mapping_type_case()) {
+ case
substrait::extensions::SimpleExtensionDeclaration::kExtensionFunction: {
+ const auto& fn = ext.extension_function();
+ if (fn.has_udf()) {
+ const auto& udf = fn.udf();
+ const auto& in_types = udf.input_types();
+ int size = in_types.size();
+ std::vector<std::pair<std::shared_ptr<DataType>, bool>> input_types;
+ for (int i=0; i<size; i++) {
+ ARROW_ASSIGN_OR_RAISE(auto input_type, FromProto(in_types.Get(i),
ext_set));
+ input_types.push_back(std::move(input_type));
+ }
+ ARROW_ASSIGN_OR_RAISE(auto output_type, FromProto(udf.output_type(),
ext_set));
+ decls.push_back(std::move(UdfDeclaration{
+ fn.name(),
+ udf.code(),
+ udf.summary(),
+ udf.description(),
+ std::move(input_types),
+ std::move(output_type),
+ }));
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+ */
Review Comment:
Is this not used?
--
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]