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

ASF GitHub Bot commented on TAJO-762:
-------------------------------------

Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/16#discussion_r13055130
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java ---
    @@ -947,14 +947,15 @@ public Expr 
visitNumeric_value_function(Numeric_value_functionContext ctx) {
       @Override
       public Expr visitExtract_expression(Extract_expressionContext ctx) {
         Expr extractTarget = new 
LiteralValue(ctx.extract_field_string.getText(), LiteralType.String);
    -    Expr extractSource;
    -    if (checkIfExist(ctx.extract_source().column_reference())) {
    -      extractSource = 
visitColumn_reference(ctx.extract_source().column_reference());
    -    } else if (checkIfExist(ctx.extract_source().datetime_literal())) {
    -      extractSource = 
visitDatetime_literal(ctx.extract_source().datetime_literal());
    -    } else {
    -      return null;
    -    }
    +    Expr extractSource = 
visitDatetime_value_expression(ctx.extract_source().datetime_value_expression());
    +//    if (checkIfExist(ctx.extract_source().column_reference())) {
    --- End diff --
    
    They seem to be obsolete code. I'll remove them before commit.


> Implements current date/time function
> -------------------------------------
>
>                 Key: TAJO-762
>                 URL: https://issues.apache.org/jira/browse/TAJO-762
>             Project: Tajo
>          Issue Type: Sub-task
>            Reporter: Hyoungjun Kim
>            Assignee: Hyoungjun Kim
>            Priority: Trivial
>         Attachments: TAJO-762.patch
>
>
> There is several functions or keywords to get current date/time value.
> - current_timestamp: Returns the current timestamp in the TIMESTAMP type.
> - current_date: Returns the current time in the DATE type.
> - current_time: Returns the current time in the TIME type.
> - now(): Returns the current timestamp in the TIMESTAMP type.
> {noformat}
> babokim=# select current_timestamp, current_date, current_time, now();
>               now              |    date    |       timetz       |            
>   now
> -------------------------------+------------+--------------------+-------------------------------
>  2014-05-13 21:22:39.566864+09 | 2014-05-13 | 21:22:39.566864+09 | 2014-05-13 
> 21:22:39.566864+09
> (1 row)
> {noformat}



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

Reply via email to