You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "AMashenkov (via GitHub)" <gi...@apache.org> on 2023/05/05 13:39:23 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request, #2031: IGNITE-19321 Sql. Fix conversion for JDBC arguments of temporal types

AMashenkov opened a new pull request, #2031:
URL: https://github.com/apache/ignite-3/pull/2031

   https://issues.apache.org/jira/browse/IGNITE-19321


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] xtern commented on a diff in pull request #2031: IGNITE-19321 Sql. Fix conversion for JDBC arguments of temporal types

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #2031:
URL: https://github.com/apache/ignite-3/pull/2031#discussion_r1191937590


##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc/JdbcPreparedStatement.java:
##########
@@ -719,6 +721,32 @@ private void setArgument(int paramIdx, Object val) throws SQLException {
         currentArgs.set(paramIdx - 1, val);
     }
 
+    /**
+     * Converts value of JDBC type to value of Ignite Client protocol types.
+     *
+     * <ul>
+     *     <li>java.sql.* to Java Time API</li>
+     * </ul>
+     */
+    private @Nullable Object convertJdbcTypeToInternal(@Nullable Object val) {
+        if (val instanceof java.util.Date) {
+            if (val instanceof Timestamp) {
+                Timestamp timeStamp = (Timestamp) val;
+                return timeStamp.toLocalDateTime();
+            } else if (val instanceof Date) {
+                Date date = (Date) val;
+                return date.toLocalDate();
+            } else if (val instanceof Time) {
+                Time time = (Time) val;
+                return time.toLocalTime();
+            }
+
+            return ((java.util.Date) val).toInstant();

Review Comment:
   In what case will we execute this line of 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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov merged pull request #2031: IGNITE-19321 Sql. Fix conversion for JDBC arguments of temporal types

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov merged PR #2031:
URL: https://github.com/apache/ignite-3/pull/2031


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org