[ 
https://issues.apache.org/jira/browse/TRAFODION-3254?focusedWorklogId=185465&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-185465
 ]

ASF GitHub Bot logged work on TRAFODION-3254:
---------------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jan/19 22:38
            Start Date: 15/Jan/19 22:38
    Worklog Time Spent: 10m 
      Work Description: DaveBirdsall commented on pull request #1767: 
[TRAFODION-3254] Add *SPLIT_PART Function* in Trafodion SQL Reference Manual
URL: https://github.com/apache/trafodion/pull/1767#discussion_r248087380
 
 

 ##########
 File path: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
 ##########
 @@ -8829,6 +8829,222 @@ with the character set specified by _char-set-name_.
 SPACE(3)
 ```
 
+<<<
+[[split_part_function]]
+== SPLIT_PART Function
+
+The SPLIT_PART function returns the n^th^ substring that is split on the 
defined `_delimiter_` and `_filed-position_`.
+
+SPLIT_PART is a Trafodion SQL extension.
+
+`SPLIT_PART (_source-string, delimiter, filed-position_)`
+
+[[syntax_description_of_split_part]]
+=== Syntax Description of SPLIT_PART
+
+* `_source-string_`
++
+is a string to be split. 
++
+NOTE: The `_source-string_` must be character and cannot be NULL.
+
+* `_delimiter_`
++
+is a delimiter to split a `_source-string_`.
++
+The delimiter can contain multiple characters, not just a single character. 
Multiple characters are considered as a whole, not individually. For example, 
if the delimiter is "coder", then the source-string is split around "coder" 
rather than "c", "o", "d", "e" and "r".
++
+NOTE: The `_delimiter_` cannot be NULL. 
++
+NOTE: The function counts from the first `_delimiter_` if the `_delimiter_` 
appears more than once in the souce-string.
++
+Example
++
+```
+SQL>SELECT SPLIT_PART ('technical writer','t',2) FROM DUAL;
+
+(EXPR)
+------------------------
+echnical wri            
+
+--- 1 row(s) selected. 
+```
++
+NOTE: The function returns an empty string if the `_delimiter_` does not exist 
in the souce-string.
++
+Example
++
+```
+SQL>SELECT SPLIT_PART ('technical_writer','@_@',1) FROM DUAL;
+
+(EXPR)
+----------------------
+                      
+
+--- 1 row(s) selected.
+```
++
+NOTE: Empty space before of after the `_delimiter_` is served as a valid part 
if the `_source-string_` starts or ends with the `_delimiter_`.
++
+Example
++
+```
+SQL>SELECT SPLIT_PART ('|t|e|c|h|n|i|c|a|l', '|', 1), SPLIT_PART 
('|w|r|i|t|e|r|', '|', 8) FROM DUAL;
+
+(EXPR)             (EXPR)       
+------------------ -------------
+                                
+
+--- 1 row(s) selected.
+```
+
+* `_filed-position_`
++
+is the n^th^ part of the `_souce-string_` to return.
 
 Review comment:
   Typo: Should be `_source-string_`
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 185465)
    Time Spent: 1h 20m  (was: 1h 10m)

> Add *SPLIT_PART Function* in Trafodion SQL Reference Manual
> -----------------------------------------------------------
>
>                 Key: TRAFODION-3254
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3254
>             Project: Apache Trafodion
>          Issue Type: Documentation
>            Reporter: Liu Yu
>            Assignee: Liu Yu
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




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

Reply via email to