diff --git a/velox/core/SimpleFunctionMetadata.h b/velox/core/SimpleFunctionMetadata.h index 9662ef9e90869..0d9cc0f8b4bcd 100644 --- a/velox/core/SimpleFunctionMetadata.h +++ b/velox/core/SimpleFunctionMetadata.h @@ -806,7 +806,7 @@ class UDFHolder { void, const std::vector&, const core::QueryConfig&, - const ConstantArg*...>::value>*; + const exec_arg_type*...>::value; // TODO Remove static constexpr bool udf_has_legacy_initialize = util::has_method< diff --git a/velox/functions/lib/Re2Functions.h b/velox/functions/lib/Re2Functions.h index ea178a2ed3922..5e7267c7ea831 100644 --- a/velox/functions/lib/Re2Functions.h +++ b/velox/functions/lib/Re2Functions.h @@ -277,11 +277,11 @@ struct Re2RegexpReplace { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* /*string*/, - const ConstantArg>* pattern, - const ConstantArg>* replacement) { + const arg_type* /*string*/, + const arg_type* pattern, + const arg_type* replacement) { if (pattern != nullptr) { - const auto processedPattern = prepareRegexpPattern(*pattern->value()); + const auto processedPattern = prepareRegexpPattern(*pattern); re_.emplace(processedPattern, RE2::Quiet); VELOX_USER_CHECK( re_->ok(), @@ -294,7 +294,7 @@ struct Re2RegexpReplace { // Constant 'replacement' with non-constant 'pattern' needs to be // processed separately for each row. if (pattern != nullptr) { - ensureProcessedReplacement(re_.value(), *replacement->value()); + ensureProcessedReplacement(re_.value(), *replacement); constantReplacement_ = true; } } @@ -303,8 +303,8 @@ struct Re2RegexpReplace { FOLLY_ALWAYS_INLINE void initialize( const std::vector& inputTypes, const core::QueryConfig& config, - const ConstantArg>* string, - const ConstantArg>* pattern) { + const arg_type* string, + const arg_type* pattern) { initialize(inputTypes, config, string, pattern, nullptr); } diff --git a/velox/functions/lib/TimeUtils.h b/velox/functions/lib/TimeUtils.h index e5b8aba45e605..39892124e0a77 100644 --- a/velox/functions/lib/TimeUtils.h +++ b/velox/functions/lib/TimeUtils.h @@ -100,7 +100,7 @@ struct InitSessionTimezone { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* /*timestamp*/) { + const arg_type* /*timestamp*/) { timeZone_ = getTimeZoneFromConfig(config); } }; diff --git a/velox/functions/prestosql/DateTimeFunctions.h b/velox/functions/prestosql/DateTimeFunctions.h index d4a2edfee10a0..51eb5f03d89f5 100644 --- a/velox/functions/prestosql/DateTimeFunctions.h +++ b/velox/functions/prestosql/DateTimeFunctions.h @@ -59,8 +59,8 @@ struct FromUnixtimeFunction { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* /*unixtime*/, - const ConstantArg>* timezone) { + const arg_type* /*unixtime*/, + const arg_type* timezone) { if (timezone != nullptr) { tzID_ = tz::getTimeZoneID((std::string_view)(*timezone)); } @@ -79,9 +79,9 @@ struct FromUnixtimeFunction { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* /*unixtime*/, - const ConstantArg>* hours, - const ConstantArg>* minutes) { + const arg_type* /*unixtime*/, + const arg_type* hours, + const arg_type* minutes) { if (hours != nullptr && minutes != nullptr) { tzID_ = tz::getTimeZoneID(*hours * 60 + *minutes); } @@ -145,21 +145,21 @@ struct DateFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* date) { + const arg_type* date) { timeZone_ = getTimeZoneFromConfig(config); } FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* timestamp) { + const arg_type* timestamp) { timeZone_ = getTimeZoneFromConfig(config); } FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* timestampWithTimezone) { + const arg_type* timestampWithTimezone) { // Do nothing. Session timezone doesn't affect the result. } @@ -971,8 +971,8 @@ struct DateTruncFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* unitString, - const ConstantArg>* /*timestamp*/) { + const arg_type* unitString, + const arg_type* /*timestamp*/) { timeZone_ = getTimeZoneFromConfig(config); if (unitString != nullptr) { @@ -983,8 +983,8 @@ struct DateTruncFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* unitString, - const ConstantArg>* /*date*/) { + const arg_type* unitString, + const arg_type* /*date*/) { if (unitString != nullptr) { unit_ = getDateUnit(*unitString, false); } @@ -993,8 +993,8 @@ struct DateTruncFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* unitString, - const ConstantArg>* /*timestamp*/) { + const arg_type* unitString, + const arg_type* /*timestamp*/) { if (unitString != nullptr) { unit_ = getTimestampUnit(*unitString); } @@ -1196,9 +1196,9 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* unitString, - const ConstantArg* /*value*/, - const ConstantArg>* /*timestamp*/) { + const arg_type* unitString, + const int64_t* /*value*/, + const arg_type* /*timestamp*/) { sessionTimeZone_ = getTimeZoneFromConfig(config); if (unitString != nullptr) { unit_ = fromDateTimeUnitString(*unitString, false /*throwIfInvalid*/); @@ -1208,9 +1208,9 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* unitString, - const ConstantArg* /*value*/, - const ConstantArg>* /*date*/) { + const arg_type* unitString, + const int64_t* /*value*/, + const arg_type* /*date*/) { if (unitString != nullptr) { unit_ = getDateUnit(*unitString, false); } @@ -1295,9 +1295,9 @@ struct DateDiffFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* unitString, - const ConstantArg>* /*timestamp1*/, - const ConstantArg>* /*timestamp2*/) { + const arg_type* unitString, + const arg_type* /*timestamp1*/, + const arg_type* /*timestamp2*/) { if (unitString != nullptr) { unit_ = fromDateTimeUnitString(*unitString, false /*throwIfInvalid*/); } @@ -1308,9 +1308,9 @@ struct DateDiffFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& /*config*/, - const ConstantArg>* unitString, - const ConstantArg>* /*date1*/, - const ConstantArg>* /*date2*/) { + const arg_type* unitString, + const arg_type* /*date1*/, + const arg_type* /*date2*/) { if (unitString != nullptr) { unit_ = getDateUnit(*unitString, false); } @@ -1319,9 +1319,9 @@ struct DateDiffFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* unitString, - const ConstantArg>* /*timestampWithTimezone1*/, - const ConstantArg>* /*timestampWithTimezone2*/) { + const arg_type* unitString, + const arg_type* /*timestampWithTimezone1*/, + const arg_type* /*timestampWithTimezone2*/) { if (unitString != nullptr) { unit_ = fromDateTimeUnitString(*unitString, false /*throwIfInvalid*/); } @@ -1390,8 +1390,8 @@ struct DateFormatFunction : public TimestampWithTimezoneSupport { FOLLY_ALWAYS_INLINE void initialize( const std::vector& /*inputTypes*/, const core::QueryConfig& config, - const ConstantArg>* /*timestamp*/, - const ConstantArg>* formatString) { + const arg_type* /*timestamp*/, + const arg_type* formatString) { sessionTimeZone_ = getTimeZoneFromConfig(config); if (formatString != nullptr) { setFormatter(*formatString);