[feature](function)Support function "current_date" in FE (#11702)

Issue Number: close #11699
This commit is contained in:
qiye
2022-09-08 16:00:57 +08:00
committed by GitHub
parent d1ab6b1db2
commit 85bd297777
2 changed files with 9 additions and 0 deletions

View File

@ -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();

View File

@ -122,6 +122,10 @@ public class ConstantExpressTest {
testConstantExpressResult(
"select current_time();",
"");
testConstantExpressResult(
"select current_date();",
"");
}
@Test