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; }