From 693fe4ecceb2ba1b78479e1a300f063f6d38d85a Mon Sep 17 00:00:00 2001 From: Morten Borup Petersen Date: Sat, 7 Sep 2024 10:02:38 +0200 Subject: [PATCH] Don't throw away `visit` result in BasePlanProtoVisitor (#118) `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: