You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tajo.apache.org by "hyoungjunkim (JIRA)" <ji...@apache.org> on 2014/01/20 12:18:24 UTC

[jira] [Work started] (TAJO-482) Implements listing functions and describing a specified function.

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

Work on TAJO-482 started by hyoungjunkim.

> Implements listing functions and describing a specified function.
> -----------------------------------------------------------------
>
>                 Key: TAJO-482
>                 URL: https://issues.apache.org/jira/browse/TAJO-482
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: function/udf
>            Reporter: hyoungjunkim
>            Assignee: hyoungjunkim
>            Priority: Minor
>             Fix For: 0.8-incubating
>
>
> I propose function related commands in Tajo's shell. This command is similar to PostgreSQL but a little different.
> - \df: list all functions
> - \df <function name>: list all functions which have a specified name(PostgreSQL uses a pattern matching). 
> {code}
> tajo> \df
>                   List of functions
> Name | Result data type | Argument data types | Type 
> -----+------------------+---------------------+-------------
> avg  | FLOAT8           | INT8                | AGGREGATION
> sum  | INT8             | INT8                | AGGREGATION
> sum  | INT4             | INT4                | AGGREGATION
> sum  | FLOAT4           | FLOAT4              | AGGREGATION
> ...
> (80 rows)
> tajo> \df sum
>                   List of functions
> Name | Result data type | Argument data types | Type 
> -----+------------------+---------------------+-------------
> sum  | INT8             | INT8                | AGGREGATION
> sum  | INT4             | INT4                | AGGREGATION
> sum  | FLOAT4           | FLOAT4              | AGGREGATION
> (3 rows)
> Function: INT8 sum(expr INT8)
> Description: The sum of a set of numbers.
> Example: 
> > select sum(*)
> {code}
> When describing a specified function 
> if all functions have same description, prints out first function description. Otherwise prints out all function.
> {code}
> tajo> \df to_char
>                   List of functions
>   Name  |  Result data type | Argument data types | Type 
> --------+-------------------+---------------------+-------------
> to_char | TEXT              | TIMETSTAMP, TEXT    | GENERAL
> to_char | TEXT              | INT4                | GENERAL
> (2 rows)
> Function: TEXT to_char(timestamp TIMETSTAMP, pattern TEXT)
> Description: convert time stamp to string.
> Example: 
> > select to_char(current_timestamp, 'HH12:MI:SS');
> 11:34:52
> Function: TEXT to_char(pattern INT4)
> Description: convert time stamp to string.
> Example: 
> > select to_char(25, '000');
> 025
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)