Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ bool SubstraitToVeloxPlanValidator::validateAggRelFunctionType(const ::substrait
auto funcName = planConverter_->toAggregationFunctionName(baseFuncName, funcStep, resultType);
auto signaturesOpt = exec::getAggregateFunctionSignatures(funcName);
if (!signaturesOpt) {
LOG_VALIDATION_MSG("can not find function signature for " + funcName + " in AggregateRel.");
LOG_VALIDATION_MSG("No function signatures found for function name: " + funcName);
return false;
}

Expand All @@ -1179,16 +1179,32 @@ bool SubstraitToVeloxPlanValidator::validateAggRelFunctionType(const ::substrait
}

if (resolveType == nullptr) {
LOG_VALIDATION_MSG("Validation failed for function " + funcName + " resolve type in AggregateRel.");
return false;
LOG_VALIDATION_MSG("Failed to resolve intermediate/return type for function " + funcName);
break;
}

resolved = true;
break;
}
}
if (!resolved) {
LOG_VALIDATION_MSG("Validation failed for function " + funcName + " bind signatures in AggregateRel.");
std::vector<std::string> inputTypeStrs;
for (const auto& type : types) {
inputTypeStrs.push_back(type->toString());
}

std::vector<std::string> signatureStrs;
for (const auto& signature : signaturesOpt.value()) {
signatureStrs.push_back(signature->toString());
}

LOG_VALIDATION_MSG(fmt::format(
"Validation failed for function {} when binding signatures.\n"
" Input types: [{}]\n"
" Registered signatures:\n {}",
funcName,
folly::join(", ", inputTypeStrs),
folly::join("\n ", signatureStrs)));
return false;
}
}
Expand Down
Loading