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

James Taylor commented on PHOENIX-1781:
---------------------------------------

Since NOW is compiled to CurrentDateFunction, the NowFunction will never be 
pushed to the server side. Thus it does not need to appear in the 
ExpressionTypes here:
{code}
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/ExpressionType.java 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/ExpressionType.java
index 92dd1d4..07286f0 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/ExpressionType.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/ExpressionType.java
@@ -51,6 +51,7 @@ import org.apache.phoenix.expression.function.MD5Function;
 import org.apache.phoenix.expression.function.MaxAggregateFunction;
 import org.apache.phoenix.expression.function.MinAggregateFunction;
 import org.apache.phoenix.expression.function.MonthFunction;
+import org.apache.phoenix.expression.function.NowFunction;
 import org.apache.phoenix.expression.function.NthValueFunction;
 import org.apache.phoenix.expression.function.PercentRankAggregateFunction;
 import org.apache.phoenix.expression.function.PercentileContAggregateFunction;
@@ -199,7 +200,8 @@ public enum ExpressionType {
     SignFunction(SignFunction.class),
     YearFunction(YearFunction.class),
     MonthFunction(MonthFunction.class),
-    SecondFunction(SecondFunction.class)
+    SecondFunction(SecondFunction.class),
+    NowFunction(NowFunction.class)
     ;
 
     ExpressionType(Class<? extends Expression> clazz) {
{code}
- Please create a unit test that uses NOW in the WHERE clause compared against 
a column value. Also, assert more than the value being not null in your test.

> Add Now()
> ---------
>
>                 Key: PHOENIX-1781
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1781
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Alicia Ying Shu
>            Assignee: Alicia Ying Shu
>         Attachments: Phoenix-1781.patch
>
>
> Phoenix currently supports current_date() that returns a timestamp. 
> From Oracle doc:
> NOW()                     A timestamp value representing the current date and 
> time
> Many customers use Now() for current timestamp and curDate() for current 
> Date. Will implement Now() similar to Phoenix current_date() so that 
> customers do not need to change their queries. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to