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

[VL] Remove useless function registering code #6245

Merged
merged 1 commit into from
Jun 27, 2024
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: 0 additions & 7 deletions cpp/velox/operators/functions/RegistrationAllFunctions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ void registerFunctionOverwrite() {
velox::registerFunction<RoundFunction, int64_t, int64_t, int32_t>({"round"});
velox::registerFunction<RoundFunction, double, double, int32_t>({"round"});
velox::registerFunction<RoundFunction, float, float, int32_t>({"round"});
// TODO: the below rand function registry can be removed after presto function registry is removed.
velox::registerFunction<velox::functions::sparksql::RandFunction, double, velox::Constant<int32_t>>({"spark_rand"});
velox::registerFunction<velox::functions::sparksql::RandFunction, double, velox::Constant<int64_t>>({"spark_rand"});

auto kRowConstructorWithNull = RowConstructorWithNullCallToSpecialForm::kRowConstructorWithNull;
velox::exec::registerVectorFunction(
Expand All @@ -74,10 +71,6 @@ void registerFunctionOverwrite() {
velox::exec::registerFunctionCallToSpecialForm(
kRowConstructorWithAllNull,
std::make_unique<RowConstructorWithNullCallToSpecialForm>(kRowConstructorWithAllNull));
velox::functions::registerBinaryIntegral<velox::functions::CheckedPlusFunction>({"check_add"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedMinusFunction>({"check_subtract"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedMultiplyFunction>({"check_multiply"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedDivideFunction>({"check_divide"});

velox::functions::registerPrestoVectorFunctions();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,63 +564,63 @@ object ExpressionConverter extends SQLConfHelper with Logging {
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
tryEval,
ExpressionNames.CHECK_ADD
ExpressionNames.CHECKED_ADD
)
case tryEval @ TryEval(a: Subtract) =>
BackendsApiManager.getSparkPlanExecApiInstance.genTryArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
tryEval,
ExpressionNames.CHECK_SUBTRACT
ExpressionNames.CHECKED_SUBTRACT
)
case tryEval @ TryEval(a: Divide) =>
BackendsApiManager.getSparkPlanExecApiInstance.genTryArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
tryEval,
ExpressionNames.CHECK_DIVIDE
ExpressionNames.CHECKED_DIVIDE
)
case tryEval @ TryEval(a: Multiply) =>
BackendsApiManager.getSparkPlanExecApiInstance.genTryArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
tryEval,
ExpressionNames.CHECK_MULTIPLY
ExpressionNames.CHECKED_MULTIPLY
)
case a: Add =>
BackendsApiManager.getSparkPlanExecApiInstance.genArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
a,
ExpressionNames.CHECK_ADD
ExpressionNames.CHECKED_ADD
)
case a: Subtract =>
BackendsApiManager.getSparkPlanExecApiInstance.genArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
a,
ExpressionNames.CHECK_SUBTRACT
ExpressionNames.CHECKED_SUBTRACT
)
case a: Multiply =>
BackendsApiManager.getSparkPlanExecApiInstance.genArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
a,
ExpressionNames.CHECK_MULTIPLY
ExpressionNames.CHECKED_MULTIPLY
)
case a: Divide =>
BackendsApiManager.getSparkPlanExecApiInstance.genArithmeticTransformer(
substraitExprName,
replaceWithExpressionTransformerInternal(a.left, attributeSeq, expressionsMap),
replaceWithExpressionTransformerInternal(a.right, attributeSeq, expressionsMap),
a,
ExpressionNames.CHECK_DIVIDE
ExpressionNames.CHECKED_DIVIDE
)
case tryEval: TryEval =>
// This is a placeholder to handle try_eval(other expressions).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ object ExpressionNames {
final val IS_NAN = "isnan"
final val NANVL = "nanvl"
final val TRY_EVAL = "try"
final val CHECK_ADD = "check_add"
final val CHECK_SUBTRACT = "check_subtract"
final val CHECK_DIVIDE = "check_divide"
final val CHECK_MULTIPLY = "check_multiply"
final val CHECKED_ADD = "checked_add"
final val CHECKED_SUBTRACT = "checked_subtract"
final val CHECKED_DIVIDE = "checked_divide"
final val CHECKED_MULTIPLY = "checked_multiply"

// SparkSQL String functions
final val ASCII = "ascii"
Expand Down
Loading