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 20:08:35 GMT

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

Hyunsik Choi commented on TAJO-343:

I thought that the number of those who already know locate function's signature are fewer
than those who don't know. Probably, those who don't know
the signature will read Tajo's guide or guess that locate function may be similar to other
SQL string functions. So, I decided that redefine is better.

In addition, Tajo also provides hive mode. It also would be helpful for some guys who want
to use both systems at the same time. In hive mode, locate function can be the same to that
of Hive.

Anyway, the migration guide that you propose is very nice idea, and the guide would be very
helpful for Hive users who want to start Tajo. Actually, I don't know what is efficient way,
but I can suggest some important points:
 * Tajo supports ANSI SQL.
  ** Almost users who use Hive already know SQL well.
  ** So, the guide needs to focus on non-SQL parts, such as File Format.
  *** For example, how to specify a file format of a table, or how to specify compression
specification of a table.
 * Non-standard function map between HQL and Tajo SQL will be helpful for that.

If you want to begin to write the migration guide, it would be great to make a separate jira

> 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

View raw message