You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2025/09/09 18:54:00 UTC
[jira] [Commented] (CALCITE-7170) Support ISO String Binding for Date/Time/Timestamp in Avatica
[ https://issues.apache.org/jira/browse/CALCITE-7170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18019213#comment-18019213 ]
Julian Hyde commented on CALCITE-7170:
--------------------------------------
Can you describe how this will work with time zones? If two users whose JVM is in different time zones execute the same script, will the effect on the database be the same?
Remember, SQL TIME, DATE and TIMESTAMP values have no time zone, and in particular a TIMESTAMP is not an instant. Your example includes an instant, "2025-08-14T15:53:00.000Z", so you need to specify how that instant should be mapped to a SQL TIMESTAMP value.
(By the way, can you use \\{code\} rather than \\{\{ and \}\} in your description.)
> Support ISO String Binding for Date/Time/Timestamp in Avatica
> -------------------------------------------------------------
>
> Key: CALCITE-7170
> URL: https://issues.apache.org/jira/browse/CALCITE-7170
> Project: Calcite
> Issue Type: Improvement
> Components: avatica
> Reporter: Sanskriti Bora
> Priority: Critical
> Labels: pull-request-available
>
> I would like to propose adding support for binding ISO-formatted string values to date, time, and timestamp types in Avatica. Currently, Avatica only supports binding these types using Java objects (such as java.sql.Date, java.sql.Time, and java.sql.Timestamp), which can be limiting for clients that work with standard string representations.
> Adding ISO string binding would improve interoperability and make it easier to work with standard date/time formats across different clients and languages.
>
> Simple client use case example:
> {{try (var connection = DriverManager.{_}getConnection{_}("jdbc:arrow-flight://localhost:5000;useEncryption=false");}}
> {{ PreparedStatement createSchemaStatement = connection.prepareStatement("create schema if not exists foo");}}
> {{ PreparedStatement createTableStatement = connection.prepareStatement("create table if not exists foo.bar (t time, d date, ts timestamp)");}}
> {{ PreparedStatement insertStatement = connection.prepareStatement("insert into test values (?, ?, ?)")}}
> {{) {}}
> {{ createSchemaStatement.execute();}}
> {{ createTableStatement.execute();}}
> {{ insertStatement.setString(1, "2025-08-14T15:53:00.000Z");}}
> {{ insertStatement.setString(2, "2025-04-01");}}
> {{ insertStatement.setString(3, "21:39:50");}}
> {{ }}
> {{ insertStatement.executeUpdate();}}
> {{}}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)