github-actions[bot] commented on code in PR #68532:
URL: https://github.com/apache/doris/pull/68532#discussion_r4122966160


##########
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:
   [P1] The new non-null TIMESTAMPTZ bind is not dialect-safe here. This base 
method sends a java.sql.Timestamp through setObject, which describes an unzoned 
TIMESTAMP; the four newly enabled mappings for Trino/Presto, ClickHouse, 
PostgreSQL, and Oracle all use this method because their executors have no 
setTimestampTz override. With a non-UTC remote/session zone (or a ClickHouse 
column zone), the UTC JNI components can be reinterpreted as wall-clock fields 
and stored at a different instant, or the driver can reject the bind. Please 
add per-dialect instant-aware binds (and session-zone setup where required) and 
write round trips covering non-UTC zones, explicit column zones, nulls, 
negative and fractional instants.



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