You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2014/07/21 20:56:38 UTC

[jira] [Updated] (PHOENIX-995) ADD ENCODE AND LPAD functions

     [ https://issues.apache.org/jira/browse/PHOENIX-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Taylor updated PHOENIX-995:
---------------------------------

    Fix Version/s: 4.1
                   3.1

> ADD ENCODE AND LPAD functions 
> ------------------------------
>
>                 Key: PHOENIX-995
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-995
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Thomas D'Silva
>            Assignee: Thomas D'Silva
>             Fix For: 3.1, 4.1
>
>         Attachments: PHOENIX-995.patch
>
>
> Add ENCODE(input number, format encodeformat) which can be used to convert a base 10 number to a  base 62 number
> Add LPAD(input string, length int [, fill string]) which can be used to left pad an input string. 
> Together these two functions can be used to generate IDs using sequences, for example:
> {code:sql}
> CREATE SEQUENCE foo.bar START WITH 0 INCREMENT BY 62
> SELECT LPAD(ENCODE(NEXT VALUE FOR foo.bar,'BASE62'), 10,'0') FROM SYSTEM."SEQUENCE"
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)