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

Julian Hyde commented on CALCITE-3005:
--------------------------------------

FWIW, the functions are not in Oracle. {{select left('hello', 2) from dual}} 
gives {{ORA-00904: "LEFT": invalid identifier}}.

In the doc you have written
{noformat}
{fn LEFT(string, integer)} | Returns the leftmost len characters from the 
*string*; Returns NULL if *string* is NULL;{noformat}
but I'd write
{noformat}
{fn LEFT(string, length)} | Returns a substring consisting of the first 
*length* characters of *string*{noformat}
Note that I renamed the parameter to *length* make it clearer. And it is 
implicit that the result is null if *string* or *length* are null.

> Implement string functions: LEFT, RIGHT
> ---------------------------------------
>
>                 Key: CALCITE-3005
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3005
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Forward Xu
>            Assignee: Forward Xu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 5h 40m
>  Remaining Estimate: 0h
>
> Some string functions including LEFT, RIGHT are not implemented now. It would 
> be great if these functions can be implemented.
> [{{LEFT(_str_}},_{{len}}_)|https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_left]
> Returns the leftmost _{{len}}_ characters from the string _{{str}}_, or 
> {{NULL}} if any argument is {{NULL}}.
> [{{RIGHT(_str_}},_{{len}}_)|https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_right]
> Returns the rightmost _{{len}}_ characters from the string _{{str}}_, or 
> {{NULL}} if any argument is {{NULL}}.



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

Reply via email to