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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to