tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAJO-341) Implement substr function
Date Sat, 30 Nov 2013 06:08:35 GMT

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

Hudson commented on TAJO-341:
-----------------------------

SUCCESS: Integrated in Tajo-trunk-postcommit #573 (See [https://builds.apache.org/job/Tajo-trunk-postcommit/573/])
TAJO-341: Implement substr function. (hyoungjunkim via hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=f9a6e9ca3dbfc7c518ad6f0d3b1c9fe3196b654e)
* tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/function/string/Substr.java
* tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestStringOperatorsAndFunctions.java
* CHANGES.txt
* tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/TajoMaster.java


> Implement substr function
> -------------------------
>
>                 Key: TAJO-341
>                 URL: https://issues.apache.org/jira/browse/TAJO-341
>             Project: Tajo
>          Issue Type: New Feature
>          Components: operator/function/udf
>            Reporter: Hyunsik Choi
>            Assignee: hyoungjunkim
>            Priority: Minor
>             Fix For: 0.8-incubating
>
>         Attachments: TAJO-341.patch
>
>
> h3. Function Definition
> {code}
> text substr(string text, from int4 [, count int4])
> {code}
> h3. Description
>  * It extracts substring (same as substring(string from from for count)). 
>  * If string is null, the result also should be null.
>  * Note that *from* is one based index.
>  * *from* can be negative integer.
>  * *count* can be omitted. If then, all string after *from* will be returned.
>  * *count* cannot be negative integer.
>  * If *count* is 0, the result should be '' instead of null.
> h3. Example and Sementic
> {code}
> hyunsik=> select substr('abcdef', 3, 2);
>  substr 
> --------
> cd
> (1 row)
> hyunsik=> select substr('abcdef',3) ;
>  substr 
> --------
>  cdef
> (1 row)
> hyunsik=> select substr('abcdef',1,1) ;
>  substr 
> --------
>  a
> (1 row)
> hyunsik=> select substr('abcdef',0,1) ;
>  substr 
> --------
>  
> (1 row)
> hyunsik=> select substr('abcdef',0,2) ;
>  substr 
> --------
>  a
> (1 row)
> {code}



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

Mime
View raw message