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

sunjincheng commented on FLINK-7128:
------------------------------------

Hi, [~fhueske] {{ExpressionParser}} will try to parse 
{{myLong.cast(TIMESTAMP)}}.   {{ExpressionParser}} can match the keyword 
{{CAST}},but when try to match {{CAST ~ "(" ~ expression ~ "," ~ dataType ~ ")" 
^^}}, the  {{TIMESTAMP}}  can not be match in {{dataType}} list. So the parser 
can not Identified it as cast call(UnaryExpression, and we can not throw 
exception at that time), but takes it as a function call.(BinaryExpression). 
Then will look up the function in {{FunctionCatalog}}. 
So from my point of view I think the  error message {{"Undefined function: 
CAST"}} are make sense.  
What do you think?

> Timestamp types in Table API documenation not correct
> -----------------------------------------------------
>
>                 Key: FLINK-7128
>                 URL: https://issues.apache.org/jira/browse/FLINK-7128
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation, Table API & SQL
>    Affects Versions: 1.3.1, 1.4.0
>            Reporter: Fabian Hueske
>            Priority: Minor
>
> The documentation for the Table API shows the type of a timestamp as 
> {{TIMESTAMP}} but it should be {{SQL_TIMESTAMP}}.
> The following projection fails
> {code}
> .select("myLong.cast(TIMESTAMP)")
> {code} 
> with the error message {{"Undefined function: CAST"}} which is confusing 
> because other {{cast}} calls in the same query work correctly. The error 
> message should rather tell the user that the type {{TIMESTAMP}} is unknown.



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

Reply via email to