tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyunsik Choi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAJO-343) Implement locate function
Date Sat, 07 Dec 2013 19:32:35 GMT

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

Hyunsik Choi commented on TAJO-343:
-----------------------------------

I leave one comment. Actually, the proposed function specification is different from MySQL
and Hive. The main reason is consistency. Most of  string functions have the first parameter
as an input string. However, locate function in Hive and MySQL has input string as the second
parameter. Since locate function is not SQL standard function, I thought that we can redefine
this function signature with more consistency.

> Implement locate function
> -------------------------
>
>                 Key: TAJO-343
>                 URL: https://issues.apache.org/jira/browse/TAJO-343
>             Project: Tajo
>          Issue Type: New Feature
>          Components: operator/function/udf
>            Reporter: Hyunsik Choi
>            Assignee: KyoungBok Lee
>            Priority: Minor
>             Fix For: 0.8-incubating
>
>         Attachments: TAJO-343.2.patch, TAJO-343.patch
>
>
> h3. Function definition
> {code}
> int4 locate(string text, substr text, [, pos])
> {code}
> h3. Description
> Returns the position of the first occurance of substr in str after position pos
>  * The result is one-based index.
>  * If string or substr is null, the result should be null.
>  * *pos* is one-based index.
>  * *pos* cannot be a negative integer.
>  * If 0 is given to *pos*, the function considers that pos is 1.
>  * If there is no pos, the function considers that pos is 1.
>  * If there is no matched substring, the result should be 0.
> h3. Example
> {code}
> SELECT locate('foobarbar', 'bar',5);
> -> 7
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message