drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DRILL-2613) Implement ResultSet.getXxx(...) number-to-number data conversions
Date Thu, 09 Apr 2015 21:39:12 GMT

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

Daniel Barclay (Drill) edited comment on DRILL-2613 at 4/9/15 9:38 PM:
-----------------------------------------------------------------------

[Summary was: "Implement (higher-priority) ResultSet.getXxx(...) data conversions"; now any
additional conversions should be in new JIRA report(s).]

Notes on requirements, possibilities, considerations, etc:

- The JDBC specification (PDF file) does not seem to require any conversions.  It does have
a matrix (in 4.1) or table (in 4.2) about conversions, but it seems to specify _allowed_ conversions,
not _required_ conversions.  (Note that it has a column labeled "Java Object Type" with entries
such as "getFloat" (a _method_ name), so ...)

- The JDBC spec's section 8.3 does seem to specify reporting some truncation of data upon
reading using warnings.  However, it's not clear whether that applies to truncation of long
values (e.g., long strings), numeric truncation in conversions, or both.  Because the spec.
refers to SQLState codes for string truncation, that section does not seem to apply to numeric
truncation.

- Other JDBC drivers implement some conversions.  It is not yet clear what is typical of JDBC
drivers or is expected of them by tools calling JDBC.

- Conversion from a narrower type (e.g., INTEGER/int) to a wider type (BIGINT/long) should
work fine.

- For conversion from a wider type to a narrower type, there is the question of what happens
if the value of the wider type is not a value of the narrower type (doesn't fit in the narrower
type).  Should that dynamic case throw an exception?  Should it ignore the overflow?  Should
it be a warning (returning a truncated value and adding a SQLWarning to the ResultSet's list
of warnings)?  Should conversion from a wide type to a narrower type not be supported?


was (Author: dsbos):
[Original summary: "Implement (higher-priority) ResultSet.getXxx(...) data conversions"]

Notes on requirements, possibilities, considerations, etc:

- The JDBC specification (PDF file) does not seem to require any conversions.  It does have
a matrix (in 4.1) or table (in 4.2) about conversions, but it seems to specify _allowed_ conversions,
not _required_ conversions.  (Note that it has a column labeled "Java Object Type" with entries
such as "getFloat" (a _method_ name), so ...)

- The JDBC spec's section 8.3 does seem to specify reporting some truncation of data upon
reading using warnings.  However, it's not clear whether that applies to truncation of long
values (e.g., long strings), numeric truncation in conversions, or both.  Because the spec.
refers to SQLState codes for string truncation, that section does not seem to apply to numeric
truncation.

- Other JDBC drivers implement some conversions.  It is not yet clear what is typical of JDBC
drivers or is expected of them by tools calling JDBC.

- Conversion from a narrower type (e.g., INTEGER/int) to a wider type (BIGINT/long) should
work fine.

- For conversion from a wider type to a narrower type, there is the question of what happens
if the value of the wider type is not a value of the narrower type (doesn't fit in the narrower
type).  Should that dynamic case throw an exception?  Should it ignore the overflow?  Should
it be a warning (returning a truncated value and adding a SQLWarning to the ResultSet's list
of warnings)?  Should conversion from a wide type to a narrower type not be supported?

> Implement ResultSet.getXxx(...) number-to-number data conversions
> -----------------------------------------------------------------
>
>                 Key: DRILL-2613
>                 URL: https://issues.apache.org/jira/browse/DRILL-2613
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>            Priority: Blocker
>             Fix For: 0.9.0
>
>




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

Mime
View raw message