[teiid-issues] [JBoss JIRA] (TEIID-3947) Incorrect handling of text cells carrying pure numerals in Excel translator

Steven Hawkins (JIRA) issues at jboss.org
Mon Feb 1 15:41:00 EST 2016


    [ https://issues.jboss.org/browse/TEIID-3947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157290#comment-13157290 ] 

Steven Hawkins commented on TEIID-3947:
---------------------------------------

Looking at POI more it won't allow getting the string value for a numeric cell and vice versa, so apparently there is very little we can do for the case of having integral value as a numeric cell in a string column.

> Incorrect handling of text cells carrying pure numerals in Excel translator
> ---------------------------------------------------------------------------
>
>                 Key: TEIID-3947
>                 URL: https://issues.jboss.org/browse/TEIID-3947
>             Project: Teiid
>          Issue Type: Bug
>            Reporter: Vijay Bhaskar Chintalapati
>            Assignee: Steven Hawkins
>            Priority: Minor
>
> When the user intends to retrieve (based on source model) textual data from a column in an Excel spreadsheet and when one or of the cells are pure numbers, what gets returned is the string representation of the double representation of the number.
> For example: If the cell has 1234, instead of returning 1234 Apache POI and DV returns 1234.0  
> Adding more detail below from a Email sent as part of client update:
> After a thorough investigation into the issue it was found that JDV relies on Apache POI APIs to get the cell content . According to the link [1], Apache POI will return the cell type as double by default when asked for the cell type and when asked for the value will return the double value. JDV is doing its due diligence of converting the value to String [2] but by then POI has already returned 11.0 for a cell value of 11. And converting 11.0 to String will still keep it at
> 11.0.
> What should ideally happen, in my opinion is, the double should be compared against its Long equivalent and see if they are the same. If Yes, then the cell value should be extracted as string disregarding the type associated with the cell. This is because regardless of how you try to maintain a cell text value of 11.0, Excel always saves (don't confuse this with how it shows) it as 11. 
> [1] https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html
> [2] https://goo.gl/nC3XoG



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list