Gabriel39 commented on code in PR #68532:
URL: https://github.com/apache/doris/pull/68532#discussion_r4123666495


##########
fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java:
##########
@@ -677,6 +677,11 @@ private int insert(VectorTable data) throws SQLException {
         return data.getNumRows();
     }
 
+    protected void setTimestampTz(int parameterIndex, java.time.LocalDateTime 
value) throws SQLException {
+        // JNI supplies UTC components; valueOf would reinterpret them in the 
JVM timezone.
+        preparedStatement.setObject(parameterIndex, 
Timestamp.from(value.toInstant(java.time.ZoneOffset.UTC)));

Review Comment:
   Fixed in 58dde319422. PostgreSQL and Oracle now bind UTC OffsetDateTime with 
TIMESTAMP_WITH_TIMEZONE; ClickHouse binds OffsetDateTime so JDBC V2 encodes the 
instant rather than JVM-local fields. Trino/Presto bind a typed timestamp 
string with an explicit UTC zone and six fractional digits. Their NULL path now 
uses Types.NULL because these drivers reject TIMESTAMP_WITH_TIMEZONE in setNull.
   
   Added JNI-column binding tests and opt-in write round trips for PostgreSQL, 
Oracle TZ/LTZ, ClickHouse explicit column zones, Trino and Presto. Coverage 
includes non-UTC JVM/session zones, both DST-fold instants, negative epochs, 
fractional values, midnight and NULL. No production session-zone change is 
needed for these explicit instant binds.
   
   Validation: six test failures reproduced before the fix; all 25 local unit 
tests and Checkstyle passed afterward. Real-driver encoding checks passed 77 
cases using PostgreSQL 42.5.0, Oracle 23, ClickHouse 0.9.8, Trino 435 and 
PrestoSQL 350. Thirteen server integration tests were skipped because 
connections were not configured; no live-server round-trip result is claimed. 
Existing ClickHouse V1 limitations remain outside the agreed scope.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to