You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/31 20:40:00 UTC

[jira] [Commented] (METAMODEL-192) Basic type-conversion (scalar) functions TO_NUMBER, TO_STRING, TO_DATE and TO_BOOLEAN

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

ASF GitHub Bot commented on METAMODEL-192:
------------------------------------------

Github user LosD commented on the issue:

    https://github.com/apache/metamodel/pull/128
  
    This has been laying around for a while. I guess some kind of decision has to be made on it sooner or later.
    
    If we need options, maybe we should have per-context flags? I see other places where that would make sense (e.g. in #165). Of course, we should still settle on sane defaults, so it doesn't really end the discussion, but apparently there's different needs and expectations. To me, the default should always be keeping the correct type. When we're getting the tools we need with METAMODEL-192/METAMODEL-193, we should try to uphold type consistency. It's then easy to cast to a floating point type if you want it to be rounded, while it's impossible to undo the damage from an automatic conversion.


> Basic type-conversion (scalar) functions TO_NUMBER, TO_STRING, TO_DATE and TO_BOOLEAN
> -------------------------------------------------------------------------------------
>
>                 Key: METAMODEL-192
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-192
>             Project: Apache MetaModel
>          Issue Type: Improvement
>            Reporter: Kasper Sørensen
>            Assignee: Kasper Sørensen
>             Fix For: 4.4.0
>
>
> With the addition of scalar functions, we should have a basic set of built-in functions.
> This issue represents the need to have basic type-conversion functions for converting values into a new data type. I propose to add 4 built-in functions for that:
> TO_STRING
> TO_NUMBER
> TO_DATE
> TO_BOOLEAN
> When possible this conversion should obviously be done by the backing database. But initially we should also cover all data context implementations by having a client-side application of it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)