markap14 commented on PR #9066: URL: https://github.com/apache/nifi/pull/9066#issuecomment-2218266795
Hey @exceptionfactory I suppose you're right, we are not necessarily converting to UTC before providing the object to Calcite. But what we really want is for Calcite not to mess with the Timestamp object we give it at all. When you call `ResultSet.getTimestamp(1)`, it should be returning the same object as if you call `Result.getObject(1)` but Avatica doesn't it see it that way. Instead, when you call `ResultSet.getTimestamp(1)` with Avatica it attempts to localize the Timestamp according to its configured TimeZone. If not specified, it uses the local timezone as that configured TimeZone. In essence what I'm doing with this PR is telling it to use UTC as the configured TImeZone so that it doesn't do any manipulation / localization. So that's why I wrote the unit test as I did - when I give it a timestamp, and then get back a timezone, it should be: (a) the same value that I gave to it, and (b) the same result regardless of whether I call `ResultSet.getObject` vs. `ResultSet.getTimestamp` -- 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]
