[teiid-issues] [JBoss JIRA] (TEIID-4995) Investigate use of org.apache.poi.ss.usermodel.DataFormatter in Excel translator

Steven Hawkins (JIRA) issues at jboss.org
Wed Jul 19 14:35:00 EDT 2017


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

Steven Hawkins commented on TEIID-4995:
---------------------------------------

> as the current default behavior is essentially corrupting the data unless the user alters the data source

It is not corrupting; it's a question of what the user sees.  The data model for excel is down to the cell level, the logic simply reflects that.  If you alter the format for the cell the underlying value will not change, just what the user sees.

We can get the format string for each cell at runtime, so scratch my metadata concern.  However defaults are locale dependent, which is not stored with the sheet/workbook (for example 123.4 in the us and 123,4 in czechia).  This could be captured if needed as a translator or extension metadata property. 

The initial proposed solution will just be a translator property called formatStrings defaulting to false.





> Investigate use of org.apache.poi.ss.usermodel.DataFormatter in Excel translator
> --------------------------------------------------------------------------------
>
>                 Key: TEIID-4995
>                 URL: https://issues.jboss.org/browse/TEIID-4995
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: Misc. Connectors
>    Affects Versions: 8.7.12.6_2, 8.12.11.6_3, 9.2.4
>         Environment: Excel translator
> Integer values in string columns
>            Reporter: Marc Shirley
>            Assignee: Steven Hawkins
>
> For integer values in a string column, values are displayed as a decimal value (for example, a value "5" is displayed as "5.0").  It looks like org.apache.poi.ss.usermodel.DataFormatter [1] by default attempts to format values in the same manner as Excel would display it [2], and would result in the integer value "5" being displayed as "5".  In the case of string columns, this would avoid the user needing to modify source data to compensate as indicated as workarounds in TEIID-3947.
> [1] https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/DataFormatter.html
> [2] The default number format will mimic the Excel General format: "#" for whole numbers and "#.##########" for decimal numbers.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the teiid-issues mailing list