Skip to content

Commit f4ac740

Browse files
author
汪细勖(WangXixu)-顺丰科技技术集团
committed
[Gluten][Function] Support function current_date
1 parent 88886d9 commit f4ac740

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

backends-velox/src/test/scala/org/apache/gluten/execution/VeloxStringFunctionsSuite.scala

+6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ class VeloxStringFunctionsSuite extends VeloxWholeStageTransformerSuite {
146146
s"from $LINEITEM_TABLE limit $LENGTH")(checkGlutenOperatorMatch[ProjectExecTransformer])
147147
}
148148

149+
test("current_date") {
150+
runQueryAndCompare(
151+
s"select l_orderkey, l_shipdate, current_date() " +
152+
s"from $LINEITEM_TABLE limit $LENGTH")(checkGlutenOperatorMatch[ProjectExecTransformer])
153+
}
154+
149155
test("year") {
150156
runQueryAndCompare(
151157
s"select l_orderkey, l_shipdate, year(l_shipdate) " +

gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ object ExpressionMappings {
188188
Sig[TruncDate](TRUNC),
189189
Sig[TruncTimestamp](DATE_TRUNC),
190190
Sig[GetTimestamp](GET_TIMESTAMP),
191+
Sig[CurrentDate](CURRENT_DATE),
191192
Sig[NextDay](NEXT_DAY),
192193
Sig[LastDay](LAST_DAY),
193194
Sig[MonthsBetween](MONTHS_BETWEEN),

shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ object ExpressionNames {
214214
final val DATE_TRUNC = "date_trunc"
215215
final val GET_TIMESTAMP = "get_timestamp" // for function: to_date/to_timestamp
216216
final val TIMESTAMP_ADD = "timestamp_add"
217+
final val CURRENT_DATE = "current_date"
217218
final val NEXT_DAY = "next_day"
218219
final val LAST_DAY = "last_day"
219220
final val MONTHS_BETWEEN = "months_between"

0 commit comments

Comments
 (0)