You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/04 11:52:14 UTC

[GitHub] [arrow] ViniciusSouzaRoque commented on a diff in pull request #12285: ARROW-14631: [C++][Gandiva] Implement Nextday Function

ViniciusSouzaRoque commented on code in PR #12285:
URL: https://github.com/apache/arrow/pull/12285#discussion_r841651133


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -241,6 +241,44 @@ int getJanWeekOfYear(const EpochTimePoint& tp) {
   return 52;
 }
 
+static const char* WEEK[] = {"SUNDAY",   "MONDAY", "TUESDAY", "WEDNESDAY",
+                             "THURSDAY", "FRIDAY", "SATURDAY"};
+
+static const int WEEK_LEN[] = {6, 6, 7, 9, 8, 6, 8};
+
+#define NEXT_DAY_FUNC(TYPE)                                                             \
+  FORCE_INLINE                                                                          \
+  gdv_date64 next_day_from_##TYPE(gdv_int64 context, gdv_##TYPE millis, const char* in, \
+                                  int32_t in_len) {                                     \
+    EpochTimePoint tp(millis);                                                          \
+    const auto& day_without_hours_and_sec = tp.ClearTimeOfDay();                        \
+    const auto& presentDate = extractDow_timestamp(tp.MillisSinceEpoch());              \

Review Comment:
   Yeah, is better. I changed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org