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

Mihai Budiu commented on CALCITE-7143:
--------------------------------------

This is really a confusion between "precision" and "scale".

I am afraid that this confusion is quite prevalent in Calcite, and fixing it 
will require quite a few changes.

 

> getString for TIMESTAMP should interpret precision as column size, not 
> decimal places
> -------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7143
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7143
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: avatica-1.26.0
>            Reporter: yanjing.wang
>            Priority: Major
>
> An inconsistency has been identified in how Avatica handles TIMESTAMP string 
> representation compared to other implementations:
> ResultSet#getString() Behavior:
> Current Behavior:
>  * Avatica: Returns 'yyyy-MM-dd HH:mm:ss.ppppp...' (with precision digits)
>  * Other implementations (Oracle): treat precision as column size rather than 
> decimal number size. ResultSetMetaData#getPrecision(): Get the designated 
> column's specified column size.
> Expected Behavior:
>  * precision should be column size when TIMESTAMP#getString method is invoked.
> References:
>  * JDBC Specification: 
> [https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html]
>  * [https://lists.apache.org/thread/n4rprwtdw4h3s0mqxhkz7rmr4776opnj]
> Also fix for DATE,TIME, TIMESTAMP WITH TIME ZONE, etc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to