You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Ben Becker (JIRA)" <ji...@apache.org> on 2013/08/04 20:11:48 UTC
[jira] [Updated] (DRILL-162) Implement substring function
[ https://issues.apache.org/jira/browse/DRILL-162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ben Becker updated DRILL-162:
-----------------------------
Attachment: substring_function.patch
> Implement substring function
> ----------------------------
>
> Key: DRILL-162
> URL: https://issues.apache.org/jira/browse/DRILL-162
> Project: Apache Drill
> Issue Type: New Feature
> Reporter: Ben Becker
> Assignee: Ben Becker
> Attachments: substring_function.patch
>
>
> Implement SUBSTRING with support for byte and character (UTF-8) sequences.
> {code}
> SUBSTRING ( expression , start, length )
> {code}
> h5. Types:
> {{expression}}: VARCHAR or VARBINARY
> {{start}}: Literal BIGINT
> {{length}}: Literal BIGINT
> {{Returns}}: Same type as the {{expression}} argument
> h5. Arguments:
> {{start}}: position within the {{expression}} value the return value will start from
> {{length}}: number of subsequent characters or bytes to return.
> h5. Aliases:
> {{SUBSTR}}
> {{BYTE_SUBSTR}}
> h5. Return Value:
> Returns the specified portion of the input string.
> h5. Notes on behavior:
> - If the start position is negative, start from abs(start) characters from the end of the buffer.
> - If no length is specified, continue to the end of the string.
> - BYTE_SUBSTR always assumes a character is 8 bits, while SUBSTR accounts for UTF-8 character sequences.
> - If the substring expression's length exceeds the value's upward bound, the
> value's length will be used.
> - If the substring is invalid (e.g. negative length), return an empty string.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira