diff --git a/velox/core/SimpleFunctionMetadata.h b/velox/core/SimpleFunctionMetadata.h index 4c4d31429ccd..e9b9dac585be 100644 --- a/velox/core/SimpleFunctionMetadata.h +++ b/velox/core/SimpleFunctionMetadata.h @@ -591,7 +591,8 @@ class SimpleFunctionMetadata : public ISimpleFunctionMetadata { builder.returnType(analysis.outputType); int32_t position = 0; for (const auto& arg : analysis.argsTypes) { - if (sizeof...(TArgs) > 0 && ConstantChecker::isConstant[position++]) { + if (ConstantChecker::getSize() > 0 && + ConstantChecker::isConstant[position++]) { builder.constantArgumentType(arg); } else { builder.argumentType(arg); diff --git a/velox/type/SimpleFunctionApi.h b/velox/type/SimpleFunctionApi.h index 70848cfc7953..fa1b0b44837e 100644 --- a/velox/type/SimpleFunctionApi.h +++ b/velox/type/SimpleFunctionApi.h @@ -233,6 +233,10 @@ template struct ConstantChecker { static constexpr bool isConstant[sizeof...(TArgs)] = { isConstantType::value...}; + + static constexpr size_t getSize() { + return sizeof...(TArgs); + } }; /// CppToType templates for types introduced above.