diff --git a/velox/functions/prestosql/DateTimeFunctions.h b/velox/functions/prestosql/DateTimeFunctions.h index 3e0c329c931e..95fa3a8bd96d 100644 --- a/velox/functions/prestosql/DateTimeFunctions.h +++ b/velox/functions/prestosql/DateTimeFunctions.h @@ -30,19 +30,17 @@ template struct ToUnixtimeFunction { VELOX_DEFINE_FUNCTION_TYPES(T); - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( double& result, const arg_type& timestamp) { result = toUnixtime(timestamp); - return true; } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( double& result, const arg_type& timestampWithTimezone) { const auto milliseconds = unpackMillisUtc(timestampWithTimezone); result = (double)milliseconds / kMillisecondsInSecond; - return true; } }; @@ -1025,7 +1023,7 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { } } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& unitString, const int64_t value, @@ -1059,11 +1057,9 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { } else { result = addToTimestamp(timestamp, unit, (int32_t)value); } - - return true; } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& unitString, const int64_t value, @@ -1081,11 +1077,9 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { auto tzID = unpackZoneKeyId(timestampWithTimezone); finalTimeStamp.toGMT(tzID); result = pack(finalTimeStamp.toMillis(), tzID); - - return true; } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& unitString, const int64_t value, @@ -1099,7 +1093,6 @@ struct DateAddFunction : public TimestampWithTimezoneSupport { } result = addToDate(date, unit, (int32_t)value); - return true; } }; @@ -1228,7 +1221,7 @@ struct DateFormatFunction : public TimestampWithTimezoneSupport { } } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& timestamp, const arg_type& formatString) { @@ -1240,15 +1233,14 @@ struct DateFormatFunction : public TimestampWithTimezoneSupport { const auto resultSize = mysqlDateTime_->format( timestamp, sessionTimeZone_, maxResultSize_, result.data()); result.resize(resultSize); - return true; } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& timestampWithTimezone, const arg_type& formatString) { auto timestamp = this->toTimestamp(timestampWithTimezone); - return call(result, timestamp, formatString); + call(result, timestamp, formatString); } private: @@ -1301,7 +1293,7 @@ struct DateParseFunction { } } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& input, const arg_type& format) { @@ -1319,7 +1311,6 @@ struct DateParseFunction { int16_t timezoneId = sessionTzID_.value_or(0); dateTimeResult.timestamp.toGMT(timezoneId); result = dateTimeResult.timestamp; - return true; } }; @@ -1415,7 +1406,7 @@ struct ParseDateTimeFunction { } } - FOLLY_ALWAYS_INLINE bool call( + FOLLY_ALWAYS_INLINE void call( out_type& result, const arg_type& input, const arg_type& format) { @@ -1434,7 +1425,6 @@ struct ParseDateTimeFunction { : sessionTzID_.value_or(0); dateTimeResult.timestamp.toGMT(timezoneId); result = pack(dateTimeResult.timestamp.toMillis(), timezoneId); - return true; } };