From 8a0abe14f3db82b3427372d0055c9c7dbc979d5d Mon Sep 17 00:00:00 2001 From: Chengcheng Jin Date: Thu, 5 Jan 2023 15:38:21 +0000 Subject: [PATCH] fix grouping sets number validate --- velox/substrait/SubstraitToVeloxPlanValidator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/velox/substrait/SubstraitToVeloxPlanValidator.cpp b/velox/substrait/SubstraitToVeloxPlanValidator.cpp index 20619badb33c..ea38c9e4d386 100644 --- a/velox/substrait/SubstraitToVeloxPlanValidator.cpp +++ b/velox/substrait/SubstraitToVeloxPlanValidator.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include "velox/substrait/SubstraitToVeloxPlanValidator.h" #include "TypeUtils.h" #include "velox/expression/SignatureBinder.h" @@ -169,6 +170,11 @@ bool SubstraitToVeloxPlanValidator::validate( } } } + // GroupIdNode constructor check + if (sExpand.groupings_size() <= 2) { + LOG(INFO) << "GroupIdNode requires two or more grouping sets."; + return false; + } return true; }