You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "akravchukdremio (via GitHub)" <gi...@apache.org> on 2026/01/15 13:46:36 UTC

[PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

akravchukdremio opened a new pull request, #48867:
URL: https://github.com/apache/arrow/pull/48867

   ### Rationale for this change
   
   Fixes #48866. The Gandiva precompiled time functions `castTIMESTAMP_utf8` and `castTIME_utf8` currently reject timestamp and time string literals with more than 3 subsecond digits (beyond millisecond precision), throwing an "Invalid millis" error. This behavior is inconsistent with other implementations.
   
   ### What changes are included in this PR?
   
   - Fixed `castTIMESTAMP_utf8` and `castTIME_utf8` functions to truncate subseconds beyond 3 digits instead of throwing an error
   - Updated tests. Replaced error-expecting tests with truncation verification tests and added edge cases
   
   ### Are these changes tested?
   
   Yes
   
   ### Are there any user-facing changes?
   
   No


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "lriggs (via GitHub)" <gi...@apache.org>.
lriggs commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2729067318


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   I see that 'FORCE_INLINE' is used a lot, so maybe that is ok.



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "lriggs (via GitHub)" <gi...@apache.org>.
lriggs commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2728940606


##########
cpp/src/gandiva/precompiled/time_test.cc:
##########
@@ -122,15 +122,26 @@ TEST(TestTime, TestCastTimestamp) {
             "Not a valid time for timestamp value 2000-01-01 00:00:100");
   context.Reset();
 
-  EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "2000-01-01 00:00:00.0001", 24), 0);
-  EXPECT_EQ(context.get_error(),
-            "Invalid millis for timestamp value 2000-01-01 00:00:00.0001");
-  context.Reset();
-
-  EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "2000-01-01 00:00:00.1000", 24), 0);
-  EXPECT_EQ(context.get_error(),
-            "Invalid millis for timestamp value 2000-01-01 00:00:00.1000");
-  context.Reset();
+  // Test truncation of subseconds to 3 digits (milliseconds)

Review Comment:
   Can you add some test cases with less than three digits?



##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   I might use the regular 'inline'. I don't see ARROW_FORCE_INLINE really being used anywhere and I don't feel like I know enough that this function should be forced inline.



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2733096769


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   @kou Got it, thanks for explanation. I've removed `ARROW_FORCE_INLINE` since we don't need force inline



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3782082373

   @akravchukdremio Could you rebase on main to fix CI failures?


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2727125818


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +566,27 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+FORCE_INLINE
+int32_t normalize_subseconds_to_millis(int32_t subseconds, int32_t num_digits) {

Review Comment:
   Sure, make sense. We couldn't define here anonymous namespace since this file is put under `extern "C"`, so I've used `static`



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "lriggs (via GitHub)" <gi...@apache.org>.
lriggs commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3806444735

   Looks good.


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "xxlaykxx (via GitHub)" <gi...@apache.org>.
xxlaykxx commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3780435227

   @kou Could you plz take a look?
   


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2727115926


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +566,27 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+FORCE_INLINE

Review Comment:
   Sure, done



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2729079752


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   > I don't see ARROW_FORCE_INLINE really being used anywhere
   
   That's right, `ARROW_FORCE_INLINE` is used only in this file: https://github.com/akravchukdremio/arrow/blob/GH-48866/cpp/src/arrow/compute/kernels/gather_internal.h#L55. Initially I've used `FORCE_INLINE`, which is used in many places as far as I can see (around 10 files in gandiva), but then I've changed it to `ARROW_FORCE_INLINE` to address this comment from committer: https://github.com/apache/arrow/pull/48867#discussion_r2726066109.
   
   >  I don't feel like I know enough that this function should be forced inline
   
   This is just a helper function, initially I've done my changes directly in `castTIMESTAMP_utf8` and `castTIME_utf8` functions: https://github.com/apache/arrow/pull/48867/changes/b377b5911192173d0f224006175aa4e45b0dfabf, but then there was a comment to factor out a common code: https://github.com/apache/arrow/pull/48867#discussion_r2715024569 - so I decided to create small function for that. 
   
   Why I've used `FORCE_INLINE` initially? Because there was already a function in this file with such macros, see here: https://github.com/akravchukdremio/arrow/blob/GH-48866/cpp/src/gandiva/precompiled/time.cc#L564-L568, and I've decided to use it too to make our code execution faster (gandiva is aiming for it, AFAIK), since invoking function is an action to put new variables in the call stack. But I agree, that probably just `inline` keyword would be enough, function is not too complex, so compiler seems anyway will inline it by just having `inline` keyword.
   
   @kou what do you think, is it fine to just remove `ARROW_FORCE_INLINE` and use only `inline` keyword instead?



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3796151476

   @lriggs Could you review this?


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2715024569


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -747,11 +747,12 @@ gdv_timestamp castTIMESTAMP_utf8(int64_t context, const char* input, gdv_int32 l
 
   // adjust the milliseconds
   if (sub_seconds_len > 0) {
-    if (sub_seconds_len > 3) {
-      const char* msg = "Invalid millis for timestamp value ";
-      set_error_for_date(length, input, msg, context);
-      return 0;
+    // Truncate to 3 digits (milliseconds precision) if more digits are provided
+    while (sub_seconds_len > 3) {
+      ts_fields[TimeFields::kSubSeconds] /= 10;
+      sub_seconds_len--;
     }

Review Comment:
   Can we factor out this common code?



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2717806889


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -747,11 +747,12 @@ gdv_timestamp castTIMESTAMP_utf8(int64_t context, const char* input, gdv_int32 l
 
   // adjust the milliseconds
   if (sub_seconds_len > 0) {
-    if (sub_seconds_len > 3) {
-      const char* msg = "Invalid millis for timestamp value ";
-      set_error_for_date(length, input, msg, context);
-      return 0;
+    // Truncate to 3 digits (milliseconds precision) if more digits are provided
+    while (sub_seconds_len > 3) {
+      ts_fields[TimeFields::kSubSeconds] /= 10;
+      sub_seconds_len--;
     }

Review Comment:
   Thanks for review, moved common code in the separate inline function



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3785547960

   > @akravchukdremio Could you rebase on main to fix CI failures?
   
   Sure, rebased PR


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2729785963


##########
cpp/src/gandiva/precompiled/time_test.cc:
##########
@@ -122,15 +122,26 @@ TEST(TestTime, TestCastTimestamp) {
             "Not a valid time for timestamp value 2000-01-01 00:00:100");
   context.Reset();
 
-  EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "2000-01-01 00:00:00.0001", 24), 0);
-  EXPECT_EQ(context.get_error(),
-            "Invalid millis for timestamp value 2000-01-01 00:00:00.0001");
-  context.Reset();
-
-  EXPECT_EQ(castTIMESTAMP_utf8(context_ptr, "2000-01-01 00:00:00.1000", 24), 0);
-  EXPECT_EQ(context.get_error(),
-            "Invalid millis for timestamp value 2000-01-01 00:00:00.1000");
-  context.Reset();
+  // Test truncation of subseconds to 3 digits (milliseconds)

Review Comment:
   We already have such test cases, see here: https://github.com/akravchukdremio/arrow/blob/GH-48866/cpp/src/gandiva/precompiled/time_test.cc#L100-L104 and https://github.com/akravchukdremio/arrow/blob/GH-48866/cpp/src/gandiva/precompiled/time_test.cc#L154-L158. Seems like enough, but if you think we need more - I can add them



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2726067464


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +566,27 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+FORCE_INLINE
+int32_t normalize_subseconds_to_millis(int32_t subseconds, int32_t num_digits) {

Review Comment:
   Can we define this in anonymous namespace? (If we can't use anonymous namespace here, can we use `static` to hide this symbol?)



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3782081916

   @xxlaykxx Could you also review this? We don't have enough maintainers for Gandiva.


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2726066109


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +566,27 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+FORCE_INLINE

Review Comment:
   Can we use `ARROW_FORCE_INLINE` instead?



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3800226069

   Fixed such error:
   ```
   /arrow/cpp/src/gandiva/precompiled/time.cc:573:16: error: 'always_inline' function might not be inlinable unless also declared 'inline' [-Werror=attributes]
     573 | static int32_t normalize_subseconds_to_millis(int32_t subseconds, int32_t num_digits) {
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1plus: all warnings being treated as errors
   ```
   by adding `inline` keyword for `normalize_subseconds_to_millis` function in this commit: https://github.com/apache/arrow/pull/48867/changes/d233f19916cc5e03d1be357c18da5b0b31d21fbf


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "akravchukdremio (via GitHub)" <gi...@apache.org>.
akravchukdremio commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2729790966


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   > I see that 'FORCE_INLINE' is used a lot, so maybe that is ok.
   
   It was initially there, then I've changed it to `ARROW_FORCE_INLINE` to address another review comment: https://github.com/apache/arrow/pull/48867#discussion_r2726066109



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #48867:
URL: https://github.com/apache/arrow/pull/48867#discussion_r2729991672


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -566,6 +567,28 @@ bool is_valid_time(const int hours, const int minutes, const int seconds) {
          seconds < 60;
 }
 
+// Normalize sub-seconds value to milliseconds precision (3 digits).
+// Truncates if more than 3 digits are provided, pads with zeros if fewer than 3 digits
+ARROW_FORCE_INLINE

Review Comment:
   If we don't need force inline, `inline` is OK.
   
   For `FORCE_INLINE` and `ARROW_FORCE_INLINE`: I want to remove `FORCE_INLINE` and `GDV_FORCE_INLINE` and use `ARROW_FORCE_INLINE` instead of them. We don't need multiple similar definitions in the same project.



-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #48867:
URL: https://github.com/apache/arrow/pull/48867


-- 
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


Re: [PR] GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in `castTIMESTAMP_utf8` and `castTIME_utf8` [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48867:
URL: https://github.com/apache/arrow/pull/48867#issuecomment-3754951600

   :warning: GitHub issue #48866 **has been automatically assigned in GitHub** to PR creator.


-- 
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