Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the function registration from Velox validation. #52

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions velox/functions/prestosql/aggregates/AverageAggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,18 @@ class AverageAggregate : public exec::Aggregate {
if (decodedPartial_.isConstantMapping()) {
if (!decodedPartial_.isNullAt(0)) {
auto decodedIndex = decodedPartial_.index(0);
if (!baseSumVector->isNullAt(decodedIndex)) {
auto count = baseCountVector->valueAt(decodedIndex);
auto sum = baseSumVector->valueAt(decodedIndex);
rows.applyToSelected([&](vector_size_t i) {
updateNonNullValue(groups[i], count, sum);
});
}
}
} else if (decodedPartial_.mayHaveNulls() || baseSumVector->mayHaveNulls()) {
} else if (decodedPartial_.mayHaveNulls()) {
rows.applyToSelected([&](vector_size_t i) {
if (decodedPartial_.isNullAt(i)) {
return;
}
auto decodedIndex = decodedPartial_.index(i);
if (baseSumVector->isNullAt(decodedIndex)) {
return;
}
updateNonNullValue(
groups[i],
baseCountVector->valueAt(decodedIndex),
Expand Down
5 changes: 0 additions & 5 deletions velox/substrait/SubstraitToVeloxPlanValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#include "velox/substrait/SubstraitToVeloxPlanValidator.h"
#include "TypeUtils.h"
#include "velox/functions/sparksql/Register.h"

#include "velox/functions/prestosql/registration/RegistrationFunctions.h"

namespace facebook::velox::substrait {

Expand Down Expand Up @@ -337,8 +334,6 @@ bool SubstraitToVeloxPlanValidator::validate(
}

bool SubstraitToVeloxPlanValidator::validate(const ::substrait::Plan& sPlan) {
functions::prestosql::registerAllScalarFunctions();
functions::sparksql::registerFunctions("");
// Create plan converter and expression converter to help the validation.
planConverter_->constructFunctionMap(sPlan);
exprConverter_ = std::make_shared<SubstraitVeloxExprConverter>(
Expand Down