From e967b33133c86c84504cc5d800bb13694707cf40 Mon Sep 17 00:00:00 2001 From: Morten Borup Petersen Date: Fri, 6 Sep 2024 16:25:54 +0200 Subject: [PATCH] Don't throw away `visit` result in BasePlanProtoVisitor `visitPlan` is marked `protected`, meaning that non-subclasses of `BasePlanProtoVisitor` (which is probably what'll initiate the `visit` most of the time) cannot have access to the `visit` result. Is there a specific reason that the traversal result has been hidden? If not, i suggest this change. If so, subclasses are obviously free to implement a `visitWithResult` function to do the same thing. --- src/substrait/textplan/converter/BasePlanProtoVisitor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/substrait/textplan/converter/BasePlanProtoVisitor.h b/src/substrait/textplan/converter/BasePlanProtoVisitor.h index 04a20996..9aa61901 100644 --- a/src/substrait/textplan/converter/BasePlanProtoVisitor.h +++ b/src/substrait/textplan/converter/BasePlanProtoVisitor.h @@ -17,8 +17,8 @@ class BasePlanProtoVisitor { BasePlanProtoVisitor() = default; // visit() begins the traversal of the entire plan. - virtual void visit(const ::substrait::proto::Plan& plan) { - visitPlan(plan); + virtual std::any visit(const ::substrait::proto::Plan& plan) { + return visitPlan(plan); } protected: