This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 85bd297777 [feature](function)Support function "current_date" in FE (#11702) 85bd297777 is described below commit 85bd297777b115a903932887676032d2f140dcdd Author: qiye <jianliang5...@gmail.com> AuthorDate: Thu Sep 8 16:00:57 2022 +0800 [feature](function)Support function "current_date" in FE (#11702) Issue Number: close #11699 --- fe/fe-core/src/main/java/org/apache/doris/rewrite/FEFunctions.java | 5 +++++ .../src/test/java/org/apache/doris/planner/ConstantExpressTest.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/rewrite/FEFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/rewrite/FEFunctions.java index cde27855cf..4cc39b5a18 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/rewrite/FEFunctions.java +++ b/fe/fe-core/src/main/java/org/apache/doris/rewrite/FEFunctions.java @@ -255,6 +255,11 @@ public class FEFunctions { ScalarType.getDefaultDateType(Type.DATE)); } + @FEFunction(name = "current_date", argTypes = {}, returnType = "DATE") + public static DateLiteral currentDate() { + return curDate(); + } + @FEFunction(name = "curtime", argTypes = {}, returnType = "TIME") public static FloatLiteral curTime() throws AnalysisException { DateLiteral now = now(); diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/ConstantExpressTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/ConstantExpressTest.java index d73a106ae6..e98d69647f 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/planner/ConstantExpressTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/planner/ConstantExpressTest.java @@ -122,6 +122,10 @@ public class ConstantExpressTest { testConstantExpressResult( "select current_time();", ""); + + testConstantExpressResult( + "select current_date();", + ""); } @Test --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org