[jira] [Commented] (DERBY-6920) Add input support for new date and time classes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DERBY-6920) Add input support for new date and time classes

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/DERBY-6920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15833806#comment-15833806 ]

Bryan Pendleton commented on DERBY-6920:
----------------------------------------

Hi! Thanks for the contribution!

I took a quick peek at your attached code changes, and it seems like you
are making very good progress!

From your initial comments in the description of this issue, it sounds like you
have in mind a phased approach to the overall implementation of this new feature.

Could you elaborate a little bit more about how you see the overall support being
separated into smaller individual phases, and could you also perhaps describe
in more detail what functionality you expect should be operational as of this
first change, and what additional functionality would become present with additional work?

Lastly, I was wondering: to what extent could we simplify the overall implementation
(perhaps at the cost of either performance or functionality) by taking the approach
of converting the LocalDate, LocalTime, and LocalDateTime values into the
corresponding java.sql.Date, java.sql.Time, and java.sql.Timestamp values as
soon as possible, and then using existing code paths from that point forward?

You made some observations about these tradeoffs in your description, but I thought
maybe the points could use some further discussion?



> Add input support for new date and time classes
> -----------------------------------------------
>
>                 Key: DERBY-6920
>                 URL: https://issues.apache.org/jira/browse/DERBY-6920
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Philippe Marschall
>         Attachments: jsr-310-input.diff
>
>
> This is the first half of DERBY-6445. The patch adds support for the new date and time classes for input only. I may add output support later but for now splitting it up makes for a smaller, easier to review and implement patch.
> A couple of notes about the implementation:
> * as the project now requires Java 1.8 I added the code directly to the classes
> * the existing tests are expanded
> * I avoided calling the provided #valueOf conversion methods for several reasons:
> ** LocalTime has nanosecond resolution but java.sql.Time only has millisecond resolution
> ** LocalDateTime can represent timestamps that can not be represented by java.sql.Timestamp because they fall into a daylight saving time transition
> ** Performance should be much better since creating a DateTimeValue instance is a simple matter of calling a few getters. No calculation or object creation is involved.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)