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

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

GitHub user babokim opened a pull request:

    https://github.com/apache/tajo/pull/16

    TAJO-762: Implements current date/time function

    I rebased after committing TAJO-825.
    While running TestCase I found the next message, but all tests is succeeded.
    This message is generated in the TestBuiltinFunctions.testRandom() because 
every random() eval makes different value.
    So I fixed TajoClient.executeQueryAndGetResult() method, some test codes 
and removed TestBuiltinFunctions.testRandom() in this patch. I'll create new 
issue for TestBuiltinFunctions.testRandom() bug.
     
    ```
    com.google.protobuf.ServiceException: 
org.apache.tajo.engine.planner.PlanningException: Duplicate alias: 1
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$TargetListManager.add(ProjectionPushDownRule.java:168)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$TargetListManager.add(ProjectionPushDownRule.java:230)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$Context.addExpr(ProjectionPushDownRule.java:363)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitScan(ProjectionPushDownRule.java:874)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitScan(ProjectionPushDownRule.java:42)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:99)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitGroupBy(BasicLogicalPlanVisitor.java:185)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitGroupBy(ProjectionPushDownRule.java:578)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitGroupBy(ProjectionPushDownRule.java:42)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:75)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitProjection(BasicLogicalPlanVisitor.java:149)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:406)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:42)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:63)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitRoot(BasicLogicalPlanVisitor.java:139)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitRoot(ProjectionPushDownRule.java:389)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitRoot(ProjectionPushDownRule.java:42)
        at 
org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:58)
        at 
org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.rewrite(ProjectionPushDownRule.java:72)
        at 
org.apache.tajo.engine.planner.rewrite.BasicQueryRewriteEngine.rewrite(BasicQueryRewriteEngine.java:63)
        at 
org.apache.tajo.engine.planner.LogicalOptimizer.optimize(LogicalOptimizer.java:74)
        at 
org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:481)
        at 
org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:147)
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/babokim/tajo TAJO-762

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tajo/pull/16.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16
    
----
commit dc78c878be8e383330188a30903688316fee1d1a
Author: 김형준 <[email protected]>
Date:   2014-05-13T14:16:19Z

    TAJO-762

commit 64a8e19288752d5094e782dfc9cd25c529d6a2f8
Author: 김형준 <[email protected]>
Date:   2014-05-22T05:49:26Z

    Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

commit 27b905808a73affae73303901cd7c0ba885327bd
Author: 김형준 <[email protected]>
Date:   2014-05-22T08:31:11Z

    TAJO-762 Implements current date/time function

----


> 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