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

Xingcan Cui commented on FLINK-9977:
------------------------------------

Hi [~twalthr], I've refined the documents for SQL built-in functions (see [this 
branch|http://example.comhttps//github.com/xccui/flink/tree/FLINK-9977-udfdocs]).
 Please take a look when it's convenient for you. There are some problems 
raised during the process.

1. It seems that the escape character has not been supported in functions such 
as "LIKE".
2. Why LOG(B, X) doesn't support B < 1? E.g., LOG(0.01, 0.1) should return 2.0.
3. The functions treat NULL in different ways (e.g., ABS(NULL) returns NULL, 
while LOG10(NULL) throws an NPE), which may confuse the users. I wonder whether 
we should make them unified.
4. It's a little weird that the two mathematical constants, PI and E, are 
accessed in different ways – PI and E(). I'm not sure if there are some reasons 
for Calcite to take PI as a {{SqlBaseContextVariable}} like "USER" and 
"CURRENT_ROLE".
5. IMO, the BIN function, which returns a string representation of an integer 
numeric in binary format, should be classified to a string function.
6. I think the "INTERVAL string range" in temporal function should be a kind of 
literal notation instead of a function.
7. TIMESTAMPADD(MINUTE, 1, DATE '2016-06-15')", "2016-06-16" will throw an 
ClassCastException( java.lang.Integer cannot be cast to java.lang.Long), which 
seems to be a bug. (It tries to cast an integer date to a long timestamp in 
RexBuilder.java:1524 - return TimestampString.fromMillisSinceEpoch((Long) o)).
8. SqlExpressionTest.scala only covers the tests for part of the functions. Not 
sure if we should complete it.
9. I cannot think out what does the "[, value ]*" in "COUNT( [ ALL | DISTINCT ] 
value [, value ]*)" mean, thus just temporarily removed it.
10. The table API doesn't support distinct aggregation.
11. The style for <code></code> is not so distinctive.

> Refine the docs for Table/SQL built-in functions
> ------------------------------------------------
>
>                 Key: FLINK-9977
>                 URL: https://issues.apache.org/jira/browse/FLINK-9977
>             Project: Flink
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Xingcan Cui
>            Assignee: Xingcan Cui
>            Priority: Minor
>
> There exist some syntax errors or inconsistencies in documents and Scala docs 
> of the Table/SQL built-in functions. This issue aims to make some 
> improvements to them.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to