You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "WillAyd (via GitHub)" <gi...@apache.org> on 2023/07/12 16:18:21 UTC

[GitHub] [arrow-adbc] WillAyd commented on a diff in pull request #900: test(c): Timestamp testing improvements

WillAyd commented on code in PR #900:
URL: https://github.com/apache/arrow-adbc/pull/900#discussion_r1261422328


##########
c/driver/sqlite/statement_reader.c:
##########
@@ -120,6 +120,12 @@ static AdbcStatusCode ArrowTimestampToIsoString(int64_t value, enum ArrowTimeUni
       break;
   }
 
+  rem = value % scale;

Review Comment:
   Fixes a bug where negative values where only changing the fractional part and not offseting the date, i.e. you'd get `1970-01-01T00:00:00.958` with ms precision instead of the expected `1969-12-31T23:59:59.958`



##########
c/driver/sqlite/statement_reader.c:
##########
@@ -120,6 +120,12 @@ static AdbcStatusCode ArrowTimestampToIsoString(int64_t value, enum ArrowTimeUni
       break;
   }
 
+  rem = value % scale;

Review Comment:
   Fixes a bug where negative values were only changing the fractional part and not offseting the date, i.e. you'd get `1970-01-01T00:00:00.958` with ms precision instead of the expected `1969-12-31T23:59:59.958`



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