diff --git a/velox/expression/ExprCompiler.cpp b/velox/expression/ExprCompiler.cpp index dfbe08769280..7e8935378ec8 100644 --- a/velox/expression/ExprCompiler.cpp +++ b/velox/expression/ExprCompiler.cpp @@ -404,13 +404,9 @@ ExprPtr compileRewrittenExpression( trackCpuUsage); } } else if (auto call = dynamic_cast(expr.get())) { - if (auto specialForm = getSpecialForm( - config, - call->name(), - resultType, - std::move(compiledInputs), - trackCpuUsage)) { - result = specialForm; + if (auto specialForm = specialFormRegistry().getSpecialForm(call->name())) { + result = specialForm->constructSpecialForm( + resultType, std::move(compiledInputs), trackCpuUsage, config); } else if ( auto func = getVectorFunction( call->name(),