[teiid-issues] [JBoss JIRA] (TEIID-5973) wrong type info for EPOCH return value

Steven Hawkins (Jira) issues at jboss.org
Mon Jun 15 08:24:02 EDT 2020


    [ https://issues.redhat.com/browse/TEIID-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14156830#comment-14156830 ] 

Steven Hawkins commented on TEIID-5973:
---------------------------------------

> For example, I should be able to find the number of seconds since the epoch with

It will already return the number of seconds.

> However, this query produces the error

Yes that needs to be corrected.  The function metadata is being inferred from the method, but the return type was left as object.

A workaroud is to add a cast:

SELECT cast(EPOCH(NOW()) as double) / 1000;

> wrong type info for EPOCH return value
> --------------------------------------
>
>                 Key: TEIID-5973
>                 URL: https://issues.redhat.com/browse/TEIID-5973
>             Project: Teiid
>          Issue Type: Enhancement
>    Affects Versions: 14.0
>            Reporter: Ken Geis
>            Assignee: Steven Hawkins
>            Priority: Major
>
> The documentation states that EPOCH(..) and EXTRACT(EPOCH FROM ..) return double. I should be able to perform calculations on those. For example, I should be able to find the number of seconds since the epoch with
> {code:sql}
> SELECT EPOCH(NOW()) / 1000;
> {code}
> However, this query produces the error
> {noformat}
> TEIID30070 The function '(EPOCH(NOW()) / 1000)' is a valid function form, but the arguments do not match a known type signature and cannot be converted using implicit type conversions.{noformat}
>  



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the teiid-issues mailing list