From 2f94c82a28ad6f20476756815c13834924f8a897 Mon Sep 17 00:00:00 2001 From: Ankita Victor Date: Thu, 15 Feb 2024 20:19:11 +0530 Subject: [PATCH] Fix function --- velox/functions/sparksql/DateTimeFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velox/functions/sparksql/DateTimeFunctions.h b/velox/functions/sparksql/DateTimeFunctions.h index b951e40d797a..eb5c321a254f 100644 --- a/velox/functions/sparksql/DateTimeFunctions.h +++ b/velox/functions/sparksql/DateTimeFunctions.h @@ -505,7 +505,7 @@ struct WeekdayFunction { // 0 = Monday, 1 = Tuesday, ..., 6 = Sunday FOLLY_ALWAYS_INLINE int32_t getWeekday(const std::tm& time) { - return (time.tm_wday - 6) % 7; + return (time.tm_wday + 6) % 7; } FOLLY_ALWAYS_INLINE void call(int32_t& result, const arg_type& date) {