From 26731a55379caddb6327c55c87554dfe3cc985dd Mon Sep 17 00:00:00 2001 From: Pratyush Verma Date: Fri, 30 Jun 2023 14:34:47 +0100 Subject: [PATCH] [native] Revert NULLIF specialForm support NULLIF expression is now translated to if/else statement in presto (java). Prestissimo does not need to handle this as a specialForm anymore. --- .../main/types/PrestoToVeloxExpr.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.cpp b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.cpp index b33c64f10cfae..d0085c8af967e 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.cpp +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.cpp @@ -611,22 +611,6 @@ TypedExprPtr convertDereferenceExpr( return std::make_shared(returnType, input, childName); } - -TypedExprPtr convertNullIfExpr( - const velox::TypePtr& returnType, - const std::vector& args) { - VELOX_CHECK_EQ(args.size(), 2); - - // Convert nullif(a, b) to if(a = b, null, a). - - std::vector newArgs = { - std::make_shared( - velox::BOOLEAN(), args, "presto.default.eq"), - std::make_shared( - returnType, velox::variant::null(returnType->kind())), - args[0]}; - return std::make_shared(returnType, newArgs, "if"); -} } // namespace TypedExprPtr VeloxExprConverter::toVeloxExpr( @@ -657,7 +641,7 @@ TypedExprPtr VeloxExprConverter::toVeloxExpr( } if (pexpr->form == protocol::Form::NULL_IF) { - return convertNullIfExpr(returnType, args); + VELOX_UNSUPPORTED("NULLIF not supported natively"); } auto form = std::string(json(pexpr->form));